|
|
@@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="isSelfDelivery" column="is_self_delivery" />
|
|
|
<result property="isSync" column="is_sync" />
|
|
|
<result property="quit" column="quit" />
|
|
|
+ <result property="isShopAccount" column="is_shop_account" />
|
|
|
<result property="isAuthentication" column="is_authentication" />
|
|
|
<result property="personAttestationTime" column="person_attestation_time" />
|
|
|
<result property="isOrgAuthentication" column="is_org_authentication" />
|
|
|
@@ -91,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<sql id="selectUserVo">
|
|
|
select u.user_id,u.company_id, u.dept_id, u.login_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.password, u.salt,u.id_type,u.id_number,u.account_id,u.is_authentication,u.receive_url_mobile_no, u.status,
|
|
|
u.del_flag, u.login_ip, u.login_date, u.create_time, u.remark,u.is_consignee,u.person_attestation_time,u.is_independently,u.is_self_delivery,is_sync,
|
|
|
- c.company_name,u.quit,
|
|
|
+ c.company_name,u.quit,u.is_shop_account,
|
|
|
d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
|
|
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,
|
|
|
suse.sales_level,suse.org_name,suse.org_code,suse.sap_employee_id,suse.boss_employee_id,suse.boss_name,suse.customer_code,suse.is_customer_manager,
|
|
|
@@ -218,7 +219,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectUserByLoginName" parameterType="String" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
|
- where u.login_name = #{userName} and u.quit is null and u.del_flag ='0' GROUP BY login_name
|
|
|
+ where u.login_name = #{userName} and u.quit is null and u.del_flag ='0' and suse.del_flag ='0' GROUP BY login_name
|
|
|
</select>
|
|
|
|
|
|
<select id="selectUserByIsManager" resultType="java.lang.String">
|
|
|
@@ -229,7 +230,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isCustomerManager !=null ">
|
|
|
and suse.is_customer_manager like concat('%',#{isCustomerManager}, '%')
|
|
|
</if>
|
|
|
- and u.quit is null
|
|
|
+ and u.quit is null and u.del_flag ='0' and suse.del_flag ='0'
|
|
|
and u.login_name is not null
|
|
|
</select>
|
|
|
|
|
|
@@ -282,12 +283,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectUserByPhoneNumber" parameterType="String" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
|
- where u.phonenumber = #{phonenumber}
|
|
|
+ where u.phonenumber = #{phonenumber} and u.quit is null and u.del_flag ='0' and suse.del_flag ='0'
|
|
|
</select>
|
|
|
|
|
|
<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
|
- where u.email = #{email} and del_flag='0' and quit is null
|
|
|
+ where u.email = #{email} and u.del_flag='0' and u.quit is null and suse.del_flag ='0'
|
|
|
</select>
|
|
|
|
|
|
<select id="checkLoginNameUnique" resultType="int">
|
|
|
@@ -304,7 +305,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
|
- where u.user_id = #{userId} and u.del_flag='0' and u.quit is null
|
|
|
+ where u.user_id = #{userId} and u.del_flag='0' and u.quit is null and suse.del_flag ='0'
|
|
|
</select>
|
|
|
|
|
|
<delete id="deleteUserById" parameterType="Long">
|
|
|
@@ -452,7 +453,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectDiyUserLoginName" resultType="java.lang.String">
|
|
|
select distinct(u.login_name)
|
|
|
- from sys_user u left join sys_user_ext b on u.user_id = b.user_id where b.post_name='DIY经销商' and u.quit is null
|
|
|
+ from sys_user u left join sys_user_ext b on u.user_id = b.user_id where b.post_name='DIY经销商' and u.quit is null and u.del_flag='0' and b.del_flag='0'
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertUserNoKey" parameterType="SysUser" >
|
|
|
@@ -486,7 +487,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectUserByEmplyeeId" parameterType="String" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
|
- where suse.sap_employee_id = #{emplyeeId}
|
|
|
+ where suse.sap_employee_id = #{emplyeeId} and suse.del_flag ='0'
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@@ -497,19 +498,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<foreach collection="array" item="customerCode" open="(" separator="," close=")">
|
|
|
#{customerCode}
|
|
|
</foreach>
|
|
|
- and sue.is_customer_manager != 0
|
|
|
+ and sue.is_customer_manager != 0 and su.quit is null and su.del_flag = '0' and sue.del_flag = '0'
|
|
|
GROUP BY sue.org_code
|
|
|
</select>
|
|
|
|
|
|
<select id="selectLoginNamesByOrgCodeSelf" resultType="java.util.Map" parameterType="String">
|
|
|
select sue.org_code customer_code,GROUP_CONCAT(su.login_name SEPARATOR '|') touser from sys_user su
|
|
|
left join sys_user_ext sue on sue.user_id = su.user_id
|
|
|
- where 1=1
|
|
|
+ where sue.del_flag = '0'
|
|
|
and sue.org_code =#{customerCode}
|
|
|
and sue.is_customer_manager in ('1','2','3')
|
|
|
and sue.is_customer_manager != 0
|
|
|
and su.quit is null
|
|
|
- and su.del_flag = 0
|
|
|
+ and su.del_flag = '0'
|
|
|
GROUP BY sue.org_code
|
|
|
</select>
|
|
|
|
|
|
@@ -523,7 +524,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
WHERE
|
|
|
c.customer_id =#{customerId}
|
|
|
and u.quit is null
|
|
|
- and u.del_flag = 0
|
|
|
+ and u.del_flag = '0'
|
|
|
+ and e.del_flag = '0'
|
|
|
GROUP BY
|
|
|
u.user_id limit 1
|
|
|
</select>
|
|
|
@@ -531,7 +533,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectLoginNamesByCustomerModelVO" resultType="java.util.Map" parameterType="String">
|
|
|
select DISTINCT sue.org_code customer_code,GROUP_CONCAT(su.login_name SEPARATOR '|') touser from sys_user su
|
|
|
left join sys_user_ext sue on sue.user_id = su.user_id
|
|
|
- where 1=1
|
|
|
+ where su.quit is null and su.del_flag = '0' and sue.del_flag = '0'
|
|
|
<if test="customerCode !=null and customerCode !='' ">
|
|
|
and sue.org_code =#{customerCode}
|
|
|
</if>
|
|
|
@@ -548,7 +550,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectLoginNamesByCostumerCode1" resultType="java.util.Map" parameterType="String">
|
|
|
select DISTINCT sue.org_code customer_code,GROUP_CONCAT(su.login_name SEPARATOR '|') touser from sys_user su
|
|
|
left join sys_user_ext sue on sue.user_id = su.user_id
|
|
|
- where sue.org_code in
|
|
|
+ where su.quit is null and su.del_flag = '0' and sue.del_flag = '0' and sue.org_code in
|
|
|
<foreach collection="array" item="customerCode" open="(" separator="," close=")">
|
|
|
#{customerCode}
|
|
|
</foreach>
|
|
|
@@ -558,7 +560,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectLoginNamesByEmployeeCode" resultType="Map" parameterType="String">
|
|
|
select DISTINCT sue.sap_employee_id employee_code,GROUP_CONCAT(su.login_name SEPARATOR '|') touser ,sue.org_code from sys_user su
|
|
|
left join sys_user_ext sue on sue.user_id = su.user_id
|
|
|
- where sue.sap_employee_id in
|
|
|
+ where su.quit is null and su.del_flag = '0' and sue.del_flag = '0' and sue.sap_employee_id in
|
|
|
<foreach collection="array" item="employeeCode" open="(" separator="," close=")">
|
|
|
#{employeeCode}
|
|
|
</foreach>
|
|
|
@@ -579,7 +581,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN sys_user_ext v ON u.user_id = v.user_id
|
|
|
left join sys_user_customer_authorization a on a.user_id = u.user_id
|
|
|
WHERE
|
|
|
- v.org_code =#{orgCode} and u.quit is null
|
|
|
+ v.org_code =#{orgCode} and u.quit is null and u.del_flag = '0' and v.del_flag = '0'
|
|
|
and v.is_customer_manager !='0' and v.is_customer_manager !='8' GROUP BY u.user_id
|
|
|
</select>
|
|
|
|
|
|
@@ -625,7 +627,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
phonenumber,
|
|
|
user_name
|
|
|
HAVING
|
|
|
- count(*) > 1) and u.del_flag=0 and u.quit is null
|
|
|
+ count(*) > 1) and u.del_flag = '0' and u.quit is null and e.del_flag = '0'
|
|
|
and e.is_customer_manager is null order by user_name
|
|
|
</select>
|
|
|
|
|
|
@@ -635,5 +637,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
sys_user u
|
|
|
LEFT JOIN sys_user_ext suse ON suse.user_id = u.user_id
|
|
|
where u.user_id = #{userId}
|
|
|
+ and u.del_flag = '0' and u.quit is null and suse.del_flag = '0'
|
|
|
</select>
|
|
|
</mapper>
|