智慧保安后台管理-外网项目备份
zhongrj
2023-09-17 8853292babb2ad94de4a3207966f1e83b767cd2d
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
<?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="org.springblade.modules.signinrecords.mapper.SignInRecordsMapper">
 
    <!--查詢考試簽到記錄分頁數據-->
    <select id="selectSignInRecordsPage" resultType="org.springblade.modules.signinrecords.vo.SignInRecordsVo">
        select
        ssir.*,
        bu.real_name realName,
        bu.cardid idCardNo,
        bd.dept_name deptName
        from sys_sign_in_records ssir
        left join
        blade_user bu
        on
        bu.id = ssir.user_id
        left join
        blade_dept bd
        on
        bu.dept_id = bd.id
        left join
        sys_training_registration str
        on
        str.id = ssir.apply_id
        where 1=1
        <if test="signInRecords.realName!=null and signInRecords.realName!=''">
            and bu.real_name like concat('%',#{signInRecords.realName},'%')
        </if>
        <if test="signInRecords.idCardNo!=null and signInRecords.idCardNo!=''">
            and bu.cardid like concat('%',#{signInRecords.idCardNo},'%')
        </if>
        <if test="signInRecords.deptName!=null and signInRecords.deptName!=''">
            and bd.dept_name like concat('%',#{signInRecords.deptName},'%')
        </if>
        <if test="signInRecords.signTime!=null and signInRecords.signTime!=''">
            and date_format(ssir.update_time,'%Y-%m-%d') = #{signInRecords.signTime}
        </if>
        <if test="signInRecords.trainingUnitId!=null and  signInRecords.trainingUnitId!=''">
            and str.training_unit_id = #{signInRecords.trainingUnitId}
        </if>
        order by ssir.id desc
    </select>
 
</mapper>