<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shkj.wms.mapper.BasRuleMapper">

    <resultMap type="com.shkj.wms.domain.BasRule" id="BasRuleResult">
        <result property="ruleId" column="rule_id"/>
        <result property="ruleName" column="rule_name"/>
        <result property="ruleNum" column="rule_num"/>
        <result property="description" column="description"/>
        <result property="status" column="status"/>
        <result property="createTime" column="create_time"/>
        <result property="createBy" column="create_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="updateBy" column="update_by"/>
    </resultMap>
    <select id="queryPageList" parameterType="com.shkj.wms.bo.BasRuleBo" resultType="com.shkj.wms.vo.BasRuleVo">
        select r.*
        from base_rule r
        where 1 = 1
        <if test="ruleNameOrCode != null and ruleNameOrCode != ''">
            and (r.rule_name like concat('%', #{ruleNameOrCode}, '%')
            or r.rule_num like concat('%', #{ruleNameOrCode}, '%'))
        </if>

        <if test="status != null and status != ''">
            and b.status = #{status}
        </if>

        order by b.customer_id desc
    </select>
</mapper>
