<?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 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} 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} 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},'1397015476211346433',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`) VALUES (#{message.id},#{message.messageId},#{message.status},DATE_FORMAT(#{message.createTime},'%Y-%m-%d %H:%i:%S')) </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.ID IN ( SELECT ru.USERID FROM sys_ru_relation ru WHERE ru.ROLEID = '1319814546311985641') </select> </mapper>