wuxw
2019-11-28 23e5eaa3ffde198acc8dd4f91f834203cfcb9988
java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml
@@ -453,13 +453,16 @@
            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>
@@ -485,13 +488,16 @@
            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 +505,71 @@
        </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>
</mapper>