TBusLableMapper.xml 3.23 KB
Newer Older
huyuchen's avatar
huyuchen committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
<?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.yifu.cloud.plus.v1.business.mapper.system.TBusLableMapper">
    <resultMap id="tBusLableMap" type="com.yifu.cloud.plus.v1.business.entity.system.TBusLable">
        <id property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="remark" column="remark"/>
        <result property="status" column="status"/>
        <result property="createUserId" column="create_user_id"/>
        <result property="createUserName" column="create_user_name"/>
        <result property="createTime" column="create_time"/>
        <result property="deleteFlag" column="delete_flag"/>
    </resultMap>
    <sql id="Base_Column_List">
             a.id,
                  a.name,
                  a.remark,
                  a.status,
                  a.create_user_id,
                  a.create_user_name,
                  a.create_time,
                  a.delete_flag
         </sql>
    <sql id="tBusLable_where">
        <if test="tBusLable != null">
            <if test="tBusLable.id != null">
                AND a.id = #{tBusLable.id}
            </if>
            <if test="tBusLable.name != null and tBusLable.name.trim() != ''">
                AND a.name like concat('%', #{tBusLable.name},'%')
            </if>
            <if test="tBusLable.remark != null and tBusLable.remark.trim() != ''">
                AND a.remark = #{tBusLable.remark}
            </if>
            <if test="tBusLable.status != null">
                AND a.status = #{tBusLable.status}
            </if>
            <if test="tBusLable.createUserId != null and tBusLable.createUserId.trim() != ''">
                AND a.create_user_id = #{tBusLable.createUserId}
            </if>
            <if test="tBusLable.createUserName != null and tBusLable.createUserName.trim() != ''">
                AND a.create_user_name = #{tBusLable.createUserName}
            </if>
            <if test="tBusLable.createTime != null">
                AND a.create_time = #{tBusLable.createTime}
            </if>
            <if test="tBusLable.deleteFlag != null">
                AND a.delete_flag = #{tBusLable.deleteFlag}
            </if>
        </if>
    </sql>
    <!--tBusLable简单分页查询-->
    <select id="getTBusLablePage" resultMap="tBusLableMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_bus_lable a
        <where>
            a.delete_flag = 0
            <include refid="tBusLable_where"/>
        </where>
        ORDER BY a.create_time desc
    </select>

    <!--list-->
    <select id="getTBusLableList" resultMap="tBusLableMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_bus_lable a
        <where>
            a.delete_flag = 0
            <include refid="tBusLable_where"/>
        </where>
        ORDER BY a.create_time desc
    </select>

    <!--判重-->
    <select id="getLableByName" resultMap="tBusLableMap">
        SELECT
        a.id
        FROM t_bus_lable a
        where
        a.delete_flag = 0
        <if test="id != null">
            and a.id != #{id}
        </if>
        AND a.name = #{name}
    </select>

</mapper>