From 3f4948a093237990407b4deaa77506c720dbb859 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期一, 18 五月 2020 15:27:16 +0800
Subject: [PATCH] Merge branch 'back' of https://github.com/java110/MicroCommunity into back

---
 java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml |  121 ++++++++++++++++++++++++++++++++++++++--
 1 files changed, 114 insertions(+), 7 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml
index efc8a25..b8d430c 100644
--- a/java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml
@@ -283,7 +283,8 @@
 
     <!-- 鏌ヨ鐢ㄦ埛灞炴�т俊鎭� -->
     <select id="queryUserInfoAttrs" parameterType="map" resultType="map">
-        select u.attr_id,u.user_id,u.spec_cd,u.value,u.b_id
+        select u.attr_id,u.user_id,u.spec_cd,u.value,u.b_id,
+        u.attr_id attrId,u.user_id userId,u.spec_cd specCd,u.b_id bId
         from u_user_attr u where u.status_cd = '0'
         <if test="bId != null and bId !=''">
             and u.b_id = #{bId}
@@ -439,59 +440,71 @@
              u_user a
             ,u_org uo
             ,u_org_staff_rel uosr
+            ,u_org puo
         where a.level_cd = '01'
             and a.user_id = uosr.staff_id
             and uosr.store_id = #{storeId}
             and uosr.org_id = uo.org_id
+            and uo.parent_org_id = puo.org_id
         <if test="parentOrgId !=null and parentOrgId != ''">
             and uo.parent_org_id = #{parentOrgId}
         </if>
             and a.status_cd = '0'
             and uo.status_cd = '0'
             and uosr.status_cd = '0'
+            and puo.status_cd = '0'
         <if test="tel !=null and tel != ''">
             and a.tel= #{tel}
         </if>
         <if test="name !=null and name != ''">
-            and a.name like contact('%',#{name},'%')
+            and a.name like concat('%',#{name},'%')
         </if>
         <if test="staffName !=null and staffName != ''">
-            and a.name like contact('%',#{staffName},'%')
+            and a.name like concat('%',#{staffName},'%')
         </if>
         <if test="staffId != null and staffId !=''">
             and uosr.staff_id = #{staffId}
+        </if>
+        <if test="orgId !=null and orgId != ''">
+            and uo.org_id = #{orgId}
         </if>
     </select>
 
     <!-- 鏌ヨ鍛樺伐鎬婚噺 -->
     <select id="getStaffs" parameterType="Map" resultType="Map">
-        select uo.org_name,uo.org_name orgName,u.user_id, u.user_id userId,u.name,u.name userName,u.email,u.address,u.location_cd,u.location_cd locationCd,
-            u.age,u.sex,u.tel,u.level_cd,u.b_id
+        select uo.org_id orgId,uo.org_name,uo.org_name orgName,u.user_id, u.user_id userId,u.name,u.name userName,u.email,u.address,u.location_cd,u.location_cd locationCd,
+            u.age,u.sex,u.tel,u.level_cd,u.b_id,puo.org_id parentOrgId,puo.org_name parentOrgName
         from
             u_user u
             ,u_org uo
             ,u_org_staff_rel uosr
+            ,u_org puo
             where u.level_cd = '01'
             and u.user_id = uosr.staff_id
             and uosr.store_id = #{storeId}
             and uosr.org_id = uo.org_id
+            and uo.parent_org_id = puo.org_id
         <if test="parentOrgId !=null and parentOrgId != ''">
             and uo.parent_org_id = #{parentOrgId}
         </if>
             and u.status_cd = '0'
             and uo.status_cd = '0'
             and uosr.status_cd = '0'
+            and puo.status_cd = '0'
         <if test="tel !=null and tel != ''">
             and u.tel= #{tel}
         </if>
         <if test="name !=null and name != ''">
-            and u.name like contact('%',#{name},'%')
+            and u.name like concat('%',#{name},'%')
         </if>
         <if test="staffName !=null and staffName != ''">
-            and u.name like contact('%',#{staffName},'%')
+            and u.name like concat('%',#{staffName},'%')
         </if>
         <if test="staffId != null and staffId !=''">
             and uosr.staff_id = #{staffId}
+        </if>
+        <if test="orgId !=null and orgId != ''">
+            and uo.org_id = #{orgId}
         </if>
         order by u.create_time desc
         <if test="page != -1 and page != null ">
@@ -499,4 +512,98 @@
         </if>
     </select>
 
+    <!-- 鏌ヨ鐢ㄦ埛 -->
+    <select id="getUsers" parameterType="Map" resultType="Map">
+        select u.user_id, u.user_id userId,u.name,u.name userName,u.email,u.address,u.password,u.location_cd,u.location_cd locationCd,
+        u.age,u.sex,u.tel,u.level_cd,u.b_id
+        from u_user u
+        <if test="openId != null and openId !=''">
+            ,u_user_attr ua
+        </if>
+        where 1= 1
+        <if test="openId != null and openId != ''">
+            and u.user_id = ua.user_id
+            and ua.spec_cd = '100201911001'
+            and ua.value = #{openId}
+            and ua.status_cd = '0'
+        </if>
+        <if test="bId != null and bId !=''">
+            and u.b_id = #{bId}
+        </if>
+        <if test="userId != null and userId != ''">
+            and u.user_id = #{userId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and u.status_cd = #{statusCd}
+        </if>
+        <if test="userIds != null and userIds != null">
+            and u.user_id in
+            <foreach collection="userIds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        order by u.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+    </select>
+
+    <select id="getUserCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from u_user u
+        <if test="openId != null and openId !=''">
+            ,u_user_attr ua
+        </if>
+        where 1= 1
+        <if test="openId != null and openId != ''">
+            and u.user_id = ua.user_id
+            and ua.spec_cd = '100201911001'
+            and ua.value = #{openId}
+            and ua.status_cd = '0'
+        </if>
+        <if test="bId != null and bId !=''">
+            and u.b_id = #{bId}
+        </if>
+        <if test="userId != null and userId != ''">
+            and u.user_id = #{userId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and u.status_cd = #{statusCd}
+        </if>
+        <if test="userIds != null and userIds != null">
+            and u.user_id in
+            <foreach collection="userIds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+
+    </select>
+
+    <!-- 鏌ヨ鐢ㄦ埛瀵嗙爜 -->
+    <select id="getUserHasPwd" parameterType="Map" resultType="Map">
+        select u.user_id, u.user_id userId,u.name,u.name userName,u.email,u.address,u.password,u.location_cd,u.location_cd locationCd,
+        u.age,u.sex,u.tel,u.level_cd levelCd,u.b_id,u.password
+        from u_user u
+        <if test="openId != null and openId !=''">
+            ,u_user_attr ua
+        </if>
+        where 1= 1
+        <if test="openId != null and openId != ''">
+            and u.user_id = ua.user_id
+            and ua.spec_cd = '100201911001'
+            and ua.value = #{openId}
+            and ua.status_cd = '0'
+        </if>
+        <if test="bId != null and bId !=''">
+            and u.b_id = #{bId}
+        </if>
+        <if test="userId != null and userId != ''">
+            and u.user_id = #{userId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and u.status_cd = #{statusCd}
+        </if>
+
+    </select>
+
 </mapper>

--
Gitblit v1.8.0