From 6d78f8ab222498d727e91983d0511d8119d95aa3 Mon Sep 17 00:00:00 2001 From: 935090232@qq.com <ak473600000> Date: Mon, 24 Jan 2022 19:34:42 +0800 Subject: [PATCH] Merge branch 'score_shop' into api_score_meger --- zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml | 41 +++++++++++++++++++++++++++++++++-------- 1 files changed, 33 insertions(+), 8 deletions(-) diff --git a/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml b/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml index ee69a10..5027633 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/common/SysUsersDao.xml @@ -56,6 +56,7 @@ <result property="signOrder" column="SIGN_ORDER"/> <result property="signDate" column="SIGN_DATE"/> <result property="salarGrad" column="salarGrad"/> + <result property="allCustomer" column="allCustomer"/> <!-- 扩展属性 --> <result property="shopName" column="SHOP_NAME"/> @@ -323,7 +324,7 @@ <set> update_time=now(), <if test="updateBy!=null"> - update_by = #{btnKey}, + update_by = #{updateBy}, </if> <if test="(suName!=null and suName!='') or (suName!='' and suName==0)"> @@ -485,6 +486,9 @@ <if test="signDate != null and signDate !='' "> sign_date = #{signDate} </if> + <if test="openIds != null and openIds !='' "> + open_ids = #{openIds} + </if> </set> WHERE su_id=#{suId} @@ -496,19 +500,19 @@ </update> <!-- 批量删除 --> - <delete id="deleteByIds" parameterType="java.util.List"> - delete from sys_users where su_id in + <update id="deleteByIds" parameterType="java.util.List"> + update sys_users set su_valid='N' where su_id in <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> #{item} </foreach> - </delete> + </update> <!-- 根据id删除 --> - <delete id="deleteById" parameterType="Long"> - DELETE FROM sys_users - where su_id=#{suId} - </delete> + <update id="deleteById" parameterType="Long"> + update sys_users set su_valid='N' + where su_id=#{suId} + </update> <!-- 根据对象删除 --> <delete id="deleteByModel" parameterType="Long"> @@ -655,6 +659,8 @@ select *, (SELECT IF(COUNT(1)>0,'Y','N') FROM sys_role a WHERE FIND_IN_SET(a.role_id,role_ids) AND role_remark ='是') shopRole, + (SELECT IF(COUNT(1)>0,'Y','N') FROM sys_role a WHERE FIND_IN_SET(a.role_id,role_ids) AND customer ='是') + allCustomer, (select GROUP_CONCAT(role_name separator ',') from sys_role where find_in_set(role_id,role_ids) ) roleName, (select com_name from sys_company where com_id=company_id) as company_name, (select shop_name from sys_shop_info where shop_id=id) as SHOP_NAME @@ -937,6 +943,8 @@ <select id="selectById" resultMap="SysUsersMap"> select *, (SELECT IF(COUNT(1)>0,'Y','N') FROM sys_role a WHERE FIND_IN_SET(a.role_id,role_ids) AND role_remark ='是') shopRole, + (SELECT IF(COUNT(1)>0,'Y','N') FROM sys_role a WHERE FIND_IN_SET(a.role_id,role_ids) AND customer ='是') + allCustomer, (select GROUP_CONCAT(role_name separator ',') from sys_role where find_in_set(role_id,role_ids) ) roleName, role_ids from sys_users @@ -949,6 +957,8 @@ select *, (SELECT IF(COUNT(1)>0,'Y','N') FROM sys_role a WHERE FIND_IN_SET(a.role_id,role_ids) AND role_remark ='是') shopRole, + (SELECT IF(COUNT(1)>0,'Y','N') FROM sys_role a WHERE FIND_IN_SET(a.role_id,role_ids) AND customer ='是') + allCustomer, (select GROUP_CONCAT(role_name separator ',') from sys_role where find_in_set(role_id,role_ids) ) roleName, role_ids from sys_users @@ -1321,4 +1331,19 @@ <select id="selectAppVersion" resultType="com.matrix.system.hive.bean.AppVersion"> select * from app_version </select> + + <select id="selectUserByOpenId" resultMap="SysUsersMap"> + select *, + (select GROUP_CONCAT(role_name separator ',') from sys_role where find_in_set(role_id,role_ids) ) roleName + from sys_users where find_in_set(#{openId}, open_ids) + <if test="companyId != null"> + and company_id=#{companyId} + </if> + </select> + + <update id="updateUserOpenId"> + update sys_users + set open_ids=#{openId} + where su_id=#{suId} + </update> </mapper> \ No newline at end of file -- Gitblit v1.9.1