| | |
| | | |
| | | <update id="setStatus"> |
| | | update sys_user set status = #{status} where id = |
| | | #{userId} |
| | | #{userId} |
| | | </update> |
| | | |
| | | <update id="changePwd"> |
| | | update sys_user set password = #{pwd} where id = |
| | | #{userId} |
| | | #{userId} |
| | | </update> |
| | | |
| | | <update id="setRoles"> |
| | | update sys_user set roleid = #{roleIds} where id = |
| | | #{userId} |
| | | #{userId} |
| | | </update> |
| | | |
| | | <delete id="deleteStoreRelations"> |
| | | delete from sys_user_store where userId = #{userId} |
| | | </delete> |
| | | <insert id="insertStoreRelations"> |
| | | insert into sys_user_store(id, userId, storeId) values |
| | | <foreach collection="storeIds" item="storeId" separator=","> |
| | | <bind name="relationId" value="@com.baomidou.mybatisplus.core.toolkit.IdWorker@getId()"/> |
| | | (#{relationId}, #{userId}, #{storeId}) |
| | | </foreach> |
| | | </insert> |
| | | <select id="getStoreIdsByUserId" resultType="java.lang.Integer"> |
| | | select distinct storeId from ( |
| | | select storeId from sys_user_store where userId = #{userId} |
| | | union all |
| | | select objectId as storeId from sys_user where id = #{userId} and objectType = 3 and objectId is not null |
| | | union all |
| | | select id as storeId from t_store where storeStaffId = #{userId} |
| | | ) relation_store |
| | | </select> |
| | | |
| | | <select id="getByAccount" resultType="com.dsh.guns.modular.system.model.User"> |
| | | select |
| | |
| | | |
| | | <select id="getUserListPage" resultType="map" parameterType="com.baomidou.mybatisplus.extension.plugins.pagination.Page"> |
| | | SELECT * FROM (select CASE when d2.simplename is null then d1.simplename else d2.simplename end as parentName, |
| | | uu.sex as sexName, |
| | | uu.sex as sexName, |
| | | d1.simplename as deptName, uu.status as statusName, |
| | | rr.roleName, |
| | | DATE_FORMAT(uu.createtime, '%Y-%m-%d %H:%i:%s') as createtime1, |
| | |
| | | </where> |
| | | order by o.id desc |
| | | </select> |
| | | <select id="searchUsers" resultType="com.dsh.guns.modular.system.model.UserListVO"> |
| | | <select id="searchUsers" resultType="com.dsh.guns.modular.system.model.UserListVO"> |
| | | select t1.id,t1.name ,t1.phone ,t1.avatar,t1.birthday,t1.sex,t1.idCard,t1.status,t1.version |
| | | ,t2.simplename as deptName from sys_user t1 |
| | | left join sys_dept t2 on t1.deptid = t2.id |
| | | ,t2.simplename as deptName from sys_user t1 |
| | | left join sys_dept t2 on t1.deptid = t2.id |
| | | <where> |
| | | <if test="query.name != null and query.name != ''"> |
| | | and t1.name like CONCAT('%',#{query.name},'%') |