wuxw
2022-07-19 05683f2b2bdbdbe21cf17ad523c21ab338bd1c54
java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml
@@ -40,36 +40,46 @@
    <!--保存数据至过程表 bo_cust 中 -->
    <insert id="saveDataToBoCust" parameterType="com.java110.entity.user.BoCust">
        <![CDATA[
            insert into bo_cust(boId,custId,name,email,cellphone,realName,sex,password,lanId,custAdress,custType,openId,state)
            values(#{boId},#{custId},#{name},#{email},#{cellphone},#{realName},#{sex},#{password},#{lanId},#{custAdress},#{custType},#{openId},#{state})
                    insert into bo_cust(boId,custId,name,email,cellphone,realName,sex,password,lanId,custAdress,custType,openId,state)
                    values(#{boId},#{custId},#{name},#{email},#{cellphone},#{realName},#{sex},#{password},#{lanId},#{custAdress},#{custType},#{openId},#{state})
        ]]>
    </insert>
    <!-- 保存数据至过程表bo_cust_attr 中-->
    <insert id="saveDataToBoCustAttr" parameterType="com.java110.entity.user.BoCustAttr">
        <![CDATA[
            insert into bo_cust_attr(boId,custId,attrCd,value,state)
            values(#{boId},#{custId},#{attrCd},#{value},#{state})
                    insert into bo_cust_attr(boId,custId,attrCd,value,state)
                    values(#{boId},#{custId},#{attrCd},#{value},#{state})
        ]]>
    </insert>
    <!-- 保存 实例客户信息 cust -->
    <insert id="saveDataToCust" parameterType="com.java110.entity.user.Cust">
        <![CDATA[
            insert into cust(custId,name,email,cellphone,realName,sex,password,lanId,custAdress,custType,openId,status_cd)
            values(#{custId},#{name},#{email},#{cellphone},#{realName},#{sex},#{password},#{lanId},#{custAdress},#{custType},#{openId},#{status_cd})
                    insert into cust(custId,name,email,cellphone,realName,sex,password,lanId,custAdress,custType,openId,status_cd)
                    values(#{custId},#{name},#{email},#{cellphone},#{realName},#{sex},#{password},#{lanId},#{custAdress},#{custType},#{openId},#{status_cd})
        ]]>
    </insert>
    <!-- 删除实例客户信息 cust -->
    <insert id="deleteDataToCust" parameterType="com.java110.entity.user.Cust">
        <![CDATA[
           delete * from cust c where c.custId = #{custId}
                   delete * from cust c where c.custId = #{custId}
        ]]>
    </insert>
    <!-- 保存 实例客户属性信息 cust_attr -->
    <insert id="saveDataToCustAttr" parameterType="com.java110.entity.user.CustAttr">
        <![CDATA[
            insert into cust_attr(custId,attrCd,value,status_cd)
            values(#{custId},#{attrCd},#{value},#{status_cd})
                    insert into cust_attr(custId,attrCd,value,status_cd)
                    values(#{custId},#{attrCd},#{value},#{status_cd})
        ]]>
    </insert>
    <!-- 删除实例客户信息 cust -->
@@ -204,6 +214,9 @@
        </if>
        <if test="tel !=null and tel != ''">
            ,u.tel= #{tel}
        </if>
        <if test="score !=null and score != ''">
            ,u.score= #{score}
        </if>
        where 1 = 1
        <if test="bId != null and bId != ''">
@@ -458,6 +471,9 @@
        <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'
@@ -486,8 +502,9 @@
    <select id="getStaffs" parameterType="Map" resultType="Map">
        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,puo.belong_community_id belongCommunityId,
        uosr.store_id storeId
        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
@@ -502,6 +519,9 @@
        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 u.status_cd = '0'
        and uo.status_cd = '0'
@@ -525,6 +545,12 @@
        <if test="bId != null and bId !=''">
            and u.b_id = #{bId}
        </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}
@@ -535,7 +561,7 @@
    <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,u.score
        from u_user u
        <if test="openId != null and openId !=''">
            ,u_user_attr ua
@@ -543,11 +569,20 @@
        <if test="key != null and key !=''">
            ,u_user_attr ub
        </if>
        <if test="unionId != null and unionId !=''">
            ,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="unionId != null and unionId != ''">
            and u.user_id = ua.user_id
            and ua.spec_cd = '100201911002'
            and ua.value = #{unionId}
            and ua.status_cd = '0'
        </if>
        <if test="key != null and key != ''">
@@ -599,6 +634,15 @@
        <if test="levelCd !=null and levelCd != ''">
            and u.level_cd= #{levelCd}
        </if>
        <if test="levelCds != null">
            and u.level_cd in
            <foreach collection="levelCds" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        <if test='userFlag !=null and userFlag =="1"'>
            and u.level_cd != '02'
        </if>
        order by u.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
@@ -611,11 +655,20 @@
        <if test="openId != null and openId !=''">
            ,u_user_attr ua
        </if>
        <if test="unionId != null and unionId !=''">
            ,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="unionId != null and unionId != ''">
            and u.user_id = ua.user_id
            and ua.spec_cd = '100201911002'
            and ua.value = #{unionId}
            and ua.status_cd = '0'
        </if>
        <if test="bId != null and bId !=''">
@@ -645,6 +698,9 @@
        <if test="openId != null and openId !=''">
            ,u_user_attr ua
        </if>
        <if test="unionId != null and unionId !=''">
            ,u_user_attr ua
        </if>
        where 1= 1
        <if test="openId != null and openId != ''">
            and u.user_id = ua.user_id
@@ -652,6 +708,12 @@
            and ua.value = #{openId}
            and ua.status_cd = '0'
        </if>
        <if test="unionId != null and unionId != ''">
            and u.user_id = ua.user_id
            and ua.spec_cd = '100201911002'
            and ua.value = #{unionId}
            and ua.status_cd = '0'
        </if>
        <if test="bId != null and bId !=''">
            and u.b_id = #{bId}
        </if>