TCheckIdCardMapper.xml 2.93 KB
Newer Older
fangxinjiang's avatar
fangxinjiang 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
<?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.check.mapper.TCheckIdCardMapper">
    <resultMap id="tCheckIdCardMap" type="com.yifu.cloud.plus.v1.check.entity.TCheckIdCard">
        <id property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="idCard" column="id_card"/>
        <result property="isTrue" column="is_true"/>
        <result property="reason" column="reason"/>
        <result property="type" column="type"/>
        <result property="createUser" column="CREATE_USER"/>
        <result property="createTime" column="CREATE_TIME"/>
    </resultMap>
    <sql id="Base_Column_List">
             a.id,
                  a.name,
                  a.id_card,
                  a.is_true,
                  a.reason,
                  a.type,
                  a.CREATE_USER,
                  a.CREATE_TIME
         </sql>
    <sql id="tCheckIdCard_where">
        <if test="tCheckIdCard != null">
            <if test="tCheckIdCard.id != null and tCheckIdCard.id.trim() != ''">
                AND a.id = #{tCheckIdCard.id}
            </if>
            <if test="tCheckIdCard.name != null and tCheckIdCard.name.trim() != ''">
                AND a.name = #{tCheckIdCard.name}
            </if>
            <if test="tCheckIdCard.idCard != null and tCheckIdCard.idCard.trim() != ''">
                AND a.id_card = #{tCheckIdCard.idCard}
            </if>
            <if test="tCheckIdCard.isTrue != null">
                AND a.is_true = #{tCheckIdCard.isTrue}
            </if>
        </if>
    </sql>
    <!--tCheckIdCard简单分页查询-->
    <select id="getTCheckIdCardPage" resultMap="tCheckIdCardMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_check_id_card a
        <where>
            1=1
            <include refid="tCheckIdCard_where"/>
        </where>
    </select>

    <!--获取所有数据-->
    <select id="getAllList" resultMap="tCheckIdCardMap">
        SELECT
            <include refid="Base_Column_List"/>
        FROM t_check_id_card a
        <where>
            1=1
            <include refid="tCheckIdCard_where"/>
        </where>
        order by a.CREATE_TIME desc
    </select>

hongguangwu's avatar
hongguangwu committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
	<select id="getAllListByList" resultMap="tCheckIdCardMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM t_check_id_card a
		where a.id_card in
		<foreach item="item" index="index" collection="idCardList" open="(" separator="," close=")">
			#{item}
		</foreach>
		order by a.CREATE_TIME desc
	</select>

	<select id="getTrueListByList" resultMap="tCheckIdCardMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM t_check_id_card a
		where a.is_true = 1 and a.id_card in
		<foreach item="item" index="index" collection="idCardList" open="(" separator="," close=")">
			#{item}
		</foreach>
		order by a.CREATE_TIME desc
	</select>

fangxinjiang's avatar
fangxinjiang committed
85
</mapper>