From 9ccc8bd3a53160a40cf60f14e5867f6ce9f6c58f Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期五, 26 十二月 2025 16:49:15 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
---
north-glass-erp/src/main/resources/mapper/userInfo/User.xml | 83 +++++++++++++++++++++++++++++++++++++++--
1 files changed, 79 insertions(+), 4 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/userInfo/User.xml b/north-glass-erp/src/main/resources/mapper/userInfo/User.xml
index 5a0e5de..c10d566 100644
--- a/north-glass-erp/src/main/resources/mapper/userInfo/User.xml
+++ b/north-glass-erp/src/main/resources/mapper/userInfo/User.xml
@@ -3,10 +3,45 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.erp.mapper.userInfo.UserMapper">
- <select id="findAll">
- SELECT *
- FROM erp_user_info.user
- where state =1
+ <resultMap id="findAllMap" type="com.example.erp.entity.userInfo.User">
+ <id property="id" column="id"/>
+ <result property="loginName" column="login_name"/>
+ <result property="userName" column="user_name"/>
+ <result property="address" column="address"/>
+ <result property="createTime" column="create_time"/>
+
+ <collection property="userRoleList" ofType="com.example.erp.entity.userInfo.UserRole">
+ <result property="userId" column="user_id"/>
+ <result property="roleId" column="role_id"/>
+ <result property="role" column="role"/>
+ </collection>
+ </resultMap>
+
+
+ <select id="findAll" resultMap="findAllMap">
+ SELECT a.*,
+ b.role_id,
+ c.role
+ FROM erp_user_info.user as a
+ left join user_role as b
+ on a.id = b.user_id
+ left join role as c
+ on b.role_id = c.id
+ where state =1 and a.id != 1
+ </select>
+ <select id="findByAddress" resultMap="findAllMap">
+ SELECT a.*,
+ b.role_id,
+ c.role
+ FROM erp_user_info.user as a
+ left join user_role as b
+ on a.id = b.user_id
+ left join role as c
+ on b.role_id = c.id
+ where state =1 and a.id != 1 and address is not null and address !=''
+ <if test="userName != null and userName != '' and userName != 'null'">
+ and user_name like concat('%',#{userName},'%')
+ </if>
</select>
<select id="findOne" >
@@ -19,6 +54,12 @@
SELECT *
FROM erp_user_info.user
where login_name=#{LoginName}
+ </select>
+
+ <select id="findOnePassWord" >
+ SELECT *
+ FROM erp_user_info.user
+ where id=#{id} and password=#{passWord}
</select>
<insert id="register" useGeneratedKeys="true" keyProperty="id">
@@ -41,4 +82,38 @@
where a.id = #{loginId}
</select>
+ <update id="userDelete">
+ update user
+ set state =0
+ where id = #{id}
+ </update>
+
+ <update id="updatePassWordById">
+ update erp_user_info.user
+ set password=#{passWord},update_time=now()
+ where id=#{id}
+ </update>
+
+ <update id="updateUserNameById">
+ update erp_user_info.user
+ set user_name=#{userName},update_time=now()
+ where id=#{id}
+ </update>
+ <update id="updateProcessMp">
+ update erp_user_info.user
+ set address=#{process},update_time=now()
+ where id=#{id}
+ </update>
+
+
+ <select id="selectOptimizeParmsById" resultType="String">
+ SELECT optimize_parms FROM erp_user_info.user WHERE user_name = #{username}
+ </select>
+
+ <select id="getUserLog" >
+ SELECT operator_id,operator,DATE_FORMAT(create_time, '%Y-%m-%d %H:%i:%s') AS format_create_time
+ FROM erp_log.log
+ WHERE create_time >= DATE_SUB(NOW(), INTERVAL 1 MONTH) and `function`='鐢ㄦ埛鐧诲綍' order by create_time desc limit 0,100
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0