java110
2021-06-16 bd59c19c6fccfc8d0bf3804c0d0c712454bd7d42
java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml
old mode 100644 new mode 100755
@@ -300,6 +300,9 @@
        <if test="attrId != null and attrId != ''">
            and u.attr_id = #{attrId}
        </if>
        <if test="specCd != null and specCd != ''">
            and u.spec_cd = #{specCd}
        </if>
    </select>
@@ -441,23 +444,27 @@
    <select id="getStaffCount" parameterType="Map" resultType="Map">
        select count(1) count
        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
        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
        <if test="storeId !=null and storeId != ''">
            and uosr.store_id = #{storeId}
            and uosr.org_id = uo.org_id
            and uo.parent_org_id = puo.org_id
            and puo.status_cd = '0'
            and uo.status_cd = '0'
        </if>
        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>
        <if test="departmentOrgId !=null and departmentOrgId != ''">
            and uosr.org_id = #{departmentOrgId}
        </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>
@@ -473,13 +480,17 @@
        <if test="orgId !=null and orgId != ''">
            and uo.org_id = #{orgId}
        </if>
        <if test="bId != null and bId !=''">
            and u.b_id = #{bId}
        </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
        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
        u.age,u.sex,u.tel,u.level_cd levelCd,u.b_id,puo.org_id parentOrgId,puo.org_name parentOrgName,puo.belong_community_id belongCommunityId,
        uosr.store_id storeId,uosr.rel_cd relCd
        from
        u_user u
        ,u_org uo
@@ -487,17 +498,21 @@
        ,u_org puo
        where u.level_cd = '01'
        and u.user_id = uosr.staff_id
        and uosr.store_id = #{storeId}
        <if test="storeId !=null and storeId != ''">
            and uosr.store_id = #{storeId}
        </if>
        and uosr.org_id = uo.org_id
        and uo.parent_org_id = puo.org_id
        and puo.status_cd = '0'
        and uo.status_cd = '0'
        <if test="parentOrgId !=null and parentOrgId != ''">
            and uo.parent_org_id = #{parentOrgId}
        </if>
        <if test="departmentOrgId !=null and departmentOrgId != ''">
            and uosr.org_id = #{departmentOrgId}
        </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>
@@ -513,6 +528,9 @@
        <if test="orgId !=null and orgId != ''">
            and uo.org_id = #{orgId}
        </if>
        <if test="bId != null and bId !=''">
            and u.b_id = #{bId}
        </if>
        order by u.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
@@ -523,10 +541,13 @@
    <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
        u.age,u.sex,u.tel,u.level_cd,u.b_id,u.level_cd levelCd
        from u_user u
        <if test="openId != null and openId !=''">
            ,u_user_attr ua
        </if>
        <if test="key != null and key !=''">
            ,u_user_attr ub
        </if>
        where 1= 1
        <if test="openId != null and openId != ''">
@@ -534,6 +555,12 @@
            and ua.spec_cd = '100201911001'
            and ua.value = #{openId}
            and ua.status_cd = '0'
        </if>
        <if test="key != null and key != ''">
            and u.user_id = ub.user_id
            and ub.spec_cd = '100202061602'
            and ub.value = #{key}
            and ub.status_cd = '0'
        </if>
        <if test="bId != null and bId !=''">
            and u.b_id = #{bId}
@@ -550,6 +577,34 @@
                #{item}
            </foreach>
        </if>
        <if test="name !=null and name != ''">
            and u.name= #{name}
        </if>
        <if test="userName !=null and userName != ''">
            and u.name= #{userName}
        </if>
        <if test="email !=null and email != ''">
            and u.email= #{email}
        </if>
        <if test="password !=null and password != ''">
            and u.password= #{password}
        </if>
        <if test="locationCd !=null and locationCd != ''">
            and u.location_cd= #{locationCd}
        </if>
        <if test="age !=null and age != ''">
            and u.age= #{age}
        </if>
        <if test="sex !=null and sex != ''">
            and u.sex= #{sex}
        </if>
        <if test="tel !=null and tel != ''">
            and u.tel= #{tel}
        </if>
        <if test="levelCd !=null and levelCd != ''">
            and u.level_cd= #{levelCd}
        </if>
        order by u.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}