“djh”
2024-12-27 3aae8ddd5b9624626921abdcc33122dccdcd5c61
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
<?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.gkhy.exam.noncoalmine.mapper.IdentificationRecordMapper">
    <select id="getList" resultType="com.gkhy.exam.noncoalmine.entity.IdentificationRecord">
        SELECT
        *
        FROM
        identification_record
        WHERE
        del_flag = 0
        <if test="query.name != null and query.name != ''">
            and name like concat('%', #{query.name}, '%')
        </if>
        <if test="query.idCard != null and query.idCard != ''">
            and id_card = #{query.idCard}
        </if>
        <if test="query.isCm != null">
            and is_cm = #{query.isCm}
        </if>
        <if test="query.startTime != null"><!-- 开始时间检索 -->
            and date_format(compare_time,'%y-%m-%d') &gt;= date_format(#{query.startTime},'%y-%m-%d')
        </if>
        <if test="query.endTime != null"><!-- 结束时间检索 -->
            and date_format(compare_time,'%y-%m-%d') &lt;= date_format(#{query.endTime},'%y-%m-%d')
        </if>
        order by compare_time desc
 
    </select>
</mapper>