<?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.casic.missiles.modular.system.dao.UserActionMapper"> <resultMap id="BaseResultMap" type="com.casic.missiles.modular.system.model.Dict"> <id column="id" property="id"/> <result column="num" property="num"/> <result column="pid" property="pid"/> <result column="name" property="name"/> <result column="code" property="code"/> <result column="tips" property="tips"/> </resultMap> <select id="getList" resultMap="BaseResultMap"> select * from sys_dict t where t.PID = '1556844890633605122' <if test="id != null and id != ''"> and t.id = #{id} </if> </select> <select id="getUserInfo" resultType="com.casic.missiles.modular.system.dto.UserDto"> SELECT * FROM sys_user t WHERE 1=1 <include refid="userInfo"/> </select> <sql id="userInfo"> <if test="userDto.account != null and userDto.account != ''"> and binary t.ACCOUNT = #{userDto.account} </if> <if test="userDto.name != null and userDto.name != ''"> and t.NAME = #{userDto.name} </if> <if test="userDto.attr1 != null and userDto.attr1 != ''"> and t.PHONE = #{userDto.attr1} </if> <if test="userDto.syncId != null and userDto.syncId != ''"> and t.SYNC_ID = #{userDto.syncId} </if> </sql> <update id="userRegister" parameterType="com.casic.missiles.modular.system.dto.UserDto"> UPDATE sys_user SET `PHONE` = #{userDto.phone},`SALT`=#{userDto.salt},logon_state=#{userDto.logonState},DOCUMENT_TYPE=#{userDto.documentType},`SYNC_ID` = #{userDto.syncId} WHERE `ACCOUNT` = #{userDto.account} and `NAME` = #{userDto.name} </update> <update id="setUserOpenId" parameterType="com.casic.missiles.modular.system.dto.UserDto"> UPDATE sys_user SET `SYNC_ID` = #{userDto.syncId},logon_state=#{userDto.logonState} WHERE `ACCOUNT` = #{userDto.account} and `NAME` = #{userDto.name} and `PHONE` = #{userDto.phone} </update> <insert id="userEmpowerment" parameterType="string"> INSERT INTO sys_ru_relation ( `ID`, `USERID`, `ROLEID`,`UPDATE_TIME`) VALUES (#{id},#{userId},#{roleId},DATE_FORMAT(#{updateTime},'%Y-%m-%d %H:%i:%S')) </insert> <insert id="insertMessageLog" parameterType="com.casic.missiles.modular.system.dto.MessageDto"> INSERT INTO bus_message ( `ID`, `MESSAGE_ID`, `STATUS`,`CREATE_TIME`,`OPEN_ID`,`apply_status`) VALUES (#{message.id},#{message.messageId},#{message.status},DATE_FORMAT(#{message.createTime},'%Y-%m-%d %H:%i:%S'),#{message.openId},#{message.applyStatus}) </insert> <update id="updateUserImg" parameterType="string"> UPDATE sys_user SET `AVATAR` = #{fileId} WHERE `ID` = #{uid} </update> <select id="getUserJurisdiction" parameterType="string" resultType="string"> SELECT url FROM sys_rm_relation t LEFT JOIN sys_resource t1 ON t.MENUID = t1.ID WHERE t.ROLEID IN ( SELECT ROLEID FROM sys_ru_relation t WHERE t.Userid = ( SELECT id FROM sys_user WHERE id = #{uid} )) </select> <select id="getPropertyManager" resultType="string"> SELECT SYNC_ID FROM sys_user t WHERE t.SALT = #{deptId} and t.SYNC_ID is not null </select> <select id="exportStaffList" resultType="com.casic.missiles.modular.system.dto.StaffInfoDto"> select job_no,staff_name,staff_gender from bus_staff_info </select> <select id="getUserList" resultType="com.casic.missiles.modular.system.dto.UserDto"> SELECT su.id, su.account, su.name, su.document_type, su.phone, su.remark, su.logon_state, sr.ID as staff_role, sr.`NAME` as staff_role_name, su.SALT as staff_type, sd.`NAME` as staff_type_name FROM sys_user su left join sys_ru_relation srr on su.id = srr.USERID left join sys_role sr on srr.ROLEID = sr.ID left join sys_dict sd on su.SALT = sd.ID <where> <if test="request.account != null and request.account != ''"> and su.account like CONCAT('%',#{request.account},'%') </if> <if test="request.name != null and request.name != ''"> and su.name like concat('%', #{request.name}, '%') </if> <if test="request.documentType != null and request.documentType != ''"> and su.document_type = #{request.documentType} </if> <if test="request.logonState != null and request.logonState != ''"> and su.logon_state = #{request.logonState} </if> <if test="request.staffType != null and request.staffType != ''"> and su.SALT = #{request.staffType} </if> <if test="request.roleName != null and request.roleName != ''"> and srr.ROLEID = #{request.roleName} </if> <if test="request.phone != null and request.phone != ''"> and su.phone like concat('%', #{request.phone}, '%') </if> </where> </select> <insert id="batchImportStaff" parameterType="com.casic.missiles.modular.system.dto.StaffInfoDto"> INSERT INTO sys_user ( `ID`, `ACCOUNT`, `SALT`, `NAME`, `PHONE`, `DOCUMENT_TYPE`, `remark`, `logon_state` ) VALUES <foreach collection="list" item="user" separator=","> ( #{user.id}, #{user.account}, #{user.staffType}, #{user.name}, #{user.phone}, #{user.documentType}, #{user.remark}, #{user.logonState} ) </foreach> </insert> <insert id="addUser" parameterType="com.casic.missiles.modular.system.dto.StaffInfoDto"> INSERT INTO sys_user ( `ID`, `ACCOUNT`, `SALT`, `NAME`, `PHONE`, `DOCUMENT_TYPE`, `remark`, `logon_state` ) VALUES( #{user.id}, #{user.account}, #{user.staffType}, #{user.name}, #{user.phone}, #{user.documentType}, #{user.remark}, #{user.logonState} ) </insert> <update id="updateUser" parameterType="com.casic.missiles.modular.system.dto.StaffInfoDto"> UPDATE sys_user SET `SALT` = #{user.staffType}, `PHONE` = #{user.phone}, `DOCUMENT_TYPE` = #{user.documentType}, `remark` = #{user.remark}, `SYNC_ID` = #{user.syncId}, `logon_state` = #{user.logonState} WHERE `ID` = #{user.id} </update> </mapper>