| | |
| | | <result column="healstats" property="healstats"/> |
| | | <result column="soil" property="soil"/> |
| | | <result column="reason_for_leav" property="reasonForLeav"/> |
| | | <result column="accreditationStatus" property="accreditationStatus"/> |
| | | <result column="ancestors" property="ancestors"/> |
| | | </resultMap> |
| | | |
| | | <!--带坐标--> |
| | |
| | | ifnull(TIMESTAMPDIFF(YEAR, SUBSTRING(bu.cardid, 7, 8), CURDATE()),0) AS age, |
| | | sll.longitude,sll.latitude, |
| | | bud.unit_name, |
| | | bd.dept_name |
| | | bud.permanent_residence_address as registered, |
| | | bd.dept_name, |
| | | bd.ancestors, |
| | | CASE WHEN sar.audit_status is not null THEN sar.audit_status ELSE -1 END AS accreditationStatus |
| | | from |
| | | blade_user bu |
| | | left join blade_user_detail bud on bud.user_id = bu.id |
| | |
| | | left join sys_live_location sll on sll.worker_id = bu.id |
| | | left join blade_role br on br.id = bu.role_id |
| | | left join sys_training_registration str on bu.id = str.user_id |
| | | LEFT JOIN sys_accreditation_records sar ON sar.user_id = bu.id |
| | | where bu.is_deleted = 0 |
| | | |
| | | <if test="user.accreditationStatus != null and user.accreditationStatus != ''"> |
| | | <if test="user.accreditationStatus == -1"> |
| | | AND sar.audit_status is null |
| | | </if> |
| | | <if test="user.accreditationStatus != -1"> |
| | | AND sar.audit_status = #{user.accreditationStatus} |
| | | </if> |
| | | </if> |
| | | |
| | | <if test="user.examinationType!=null and user.examinationType != ''"> |
| | | <if test="user.examinationType == 0"> |
| | | and (bu.examination_type = #{user.examinationType} or bu.examination_type is null or bu.examination_type ='') |
| | |
| | | </if> |
| | | <if test="user.roleId!=null and user.roleId != ''"> |
| | | and bu.role_id = #{user.roleId} |
| | | </if> |
| | | <if test="user.auditStatus != null and user.auditStatus != ''"> |
| | | and bu.audit_status = #{user.auditStatus} |
| | | </if> |
| | | <if test="user.roleAlias!=null and user.roleAlias != ''"> |
| | | and br.role_alias = '保安' |
| | |
| | | <if test="user.userType!=null and user.userType != ''"> |
| | | and bu.user_type = #{user.userType} |
| | | </if> |
| | | <if test="user.auditStatus != null and user.auditStatus != ''"> |
| | | and bu.audit_status = #{user.auditStatus} |
| | | </if> |
| | | <if test="user.securitynumber!=null and user.securitynumber != ''"> |
| | | and bu.securitynumber like concat('%', #{user.securitynumber},'%') |
| | | </if> |
| | |
| | | </select> |
| | | |
| | | <select id="exportUser" resultType="org.springblade.modules.system.excel.UserExcel"> |
| | | SELECT id, |
| | | tenant_id, |
| | | user_type, |
| | | account, |
| | | name, |
| | | real_name, |
| | | email, |
| | | phone, |
| | | birthday, |
| | | role_id, |
| | | dept_id, |
| | | post_id |
| | | FROM blade_user ${ew.customSqlSegment} |
| | | SELECT |
| | | bu.id, |
| | | bd.dept_name AS deptId, |
| | | bu.real_name, |
| | | bu.phone, |
| | | bu.sex, |
| | | bu.cardid |
| | | FROM |
| | | blade_user bu |
| | | LEFT JOIN blade_dept bd ON bu.dept_id = bd.id |
| | | where bu.is_deleted = 0 |
| | | <if test="obj.account != null and obj.account != ''"> |
| | | AND bu.account LIKE CONCAT('%',#{obj.account},'%') |
| | | </if> |
| | | <if test="obj.realName != null and obj.realName != ''"> |
| | | AND bu.real_name LIKE CONCAT('%',#{obj.realName},'%') |
| | | </if> |
| | | <if test="obj.deptId != null and obj.deptId != ''"> |
| | | AND bu.dept_id = #{obj.deptId} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--通过 身份证号查询用户信息--> |
| | | <select id="getUserInfoByIdCardNo" resultType="org.springblade.modules.system.entity.User"> |
| | | SELECT id, name, real_name RealName,securitynumber |
| | | SELECT id, name, real_name RealName,securitynumber,dept_id,dispatch |
| | | FROM blade_user |
| | | where 1=1 |
| | | and is_deleted = 0 |
| | |
| | | <if test="user.jurisdiction!=null and user.jurisdiction != ''"> |
| | | and bu.jurisdiction = #{user.jurisdiction} |
| | | </if> |
| | | <if test="user.unitName!=null and user.unitName != ''"> |
| | | and bud.unit_name like concat('%', #{user.unitName},'%') |
| | | </if> |
| | | <!-- <if test="user.unitName!=null and user.unitName != ''">--> |
| | | <!-- and bud.unit_name like concat('%', #{user.unitName},'%')--> |
| | | <!-- </if>--> |
| | | <if test="user.securitynumber!=null and user.securitynumber != ''"> |
| | | and bu.securitynumber = #{user.securitynumber} |
| | | </if> |
| | |
| | | </choose> |
| | | </update> |
| | | |
| | | |
| | | <update id="batchAudit"> |
| | | UPDATE BLADE_USER SET audit_status = #{auditStatus} |
| | | WHERE is_deleted = 0 and id in |
| | | <foreach collection="ids.split(',')" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <!--判断是否报名--> |
| | | <select id="getUserIsApply" resultType="org.springblade.modules.system.entity.User"> |
| | | select bu.* from blade_user bu |
| | |
| | | and bu.role_id = '1412226235153731586' |
| | | and bud.id is null |
| | | </select> |
| | | <select id="getUserInfoDetail" resultType="org.springblade.modules.system.vo.UserInfoDetail"> |
| | | SELECT * FROM blade_user bu |
| | | LEFT JOIN blade_user_detail bud on bud.user_id = bu.id and bud.is_deleted = 0 |
| | | WHERE bu.is_deleted = 0 and bu.id = #{id} |
| | | </select> |
| | | <select id="getUserInfoByIdCardNoAndSecurityNumber" |
| | | resultType="org.springblade.modules.system.entity.User"> |
| | | |
| | | SELECT id, name, real_name RealName,securitynumber,dept_id |
| | | FROM blade_user |
| | | where 1=1 |
| | | and is_deleted = 0 |
| | | and status = 1 |
| | | and cardid = #{cardid} |
| | | and securitynumber = #{securityNumber} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |