Administrator
2022-06-09 1578f99b76d84133fc63e5902ed70336e60d23cd
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
<?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.securityapply.mapper.SecurityApplyMapper">
 
    <!--自定义查询保安员证申诉分页数据-->
    <select id="selectSecurityApplyPage" resultType="org.springblade.modules.securityapply.vo.SecurityApplyVO">
        select
        ssa.*,
        bu.real_name realName,IF(mod(SUBSTR(bu.cardid,17,1),2),1,2) sex,bu.cardid,
        bd.dept_name deptName,
        bu1.real_name applyName
        from sys_security_apply ssa
        left join blade_user bu on bu.id = ssa.user_id
        left join blade_dept bd on bd.id = bu.dept_id
        left join blade_user bu1 on bu1.id = ssa.create_user
        where 1=1
        <if test="securityApply.realName!=null and securityApply.realName!=''">
            and bu.real_name like concat('%',#{securityApply.realName},'%')
        </if>
        <if test="securityApply.cardid!=null and securityApply.cardid!=''">
            and bu.cardid like concat('%',#{securityApply.cardid},'%')
        </if>
        <if test="securityApply.number!=null and securityApply.number!=''">
            and ssa.number like concat('%',#{securityApply.number},'%')
        </if>
        <if test="securityApply.deptName!=null and securityApply.deptName!=''">
            and bd.dept_name like concat('%',#{securityApply.deptName},'%')
        </if>
        <if test="securityApply.auditStatus!=null">
            and ssa.audit_status = #{securityApply.auditStatus}
        </if>
        <if test="securityApply.startTime!=null and securityApply.startTime!=''">
            and date_format(ssa.create_time,'%Y-%m-%d')&gt;=#{securityApply.startTime}
        </if>
        <if test="securityApply.endTime!=null and securityApply.endTime!=''">
            and date_format(ssa.create_time,'%Y-%m-%d')&lt;=#{securityApply.endTime}
        </if>
        order by ssa.id desc
    </select>
 
</mapper>