<?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')>=#{securityApply.startTime}
|
</if>
|
<if test="securityApply.endTime!=null and securityApply.endTime!=''">
|
and date_format(ssa.create_time,'%Y-%m-%d')<=#{securityApply.endTime}
|
</if>
|
order by ssa.id desc
|
</select>
|
|
</mapper>
|