|
@@ -102,7 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
left join sys_company c on u.company_id = c.id
|
|
left join sys_company c on u.company_id = c.id
|
|
|
left join sys_user_role ur on u.user_id = ur.user_id
|
|
left join sys_user_role ur on u.user_id = ur.user_id
|
|
|
left join sys_role r on r.role_id = ur.role_id
|
|
left join sys_role r on r.role_id = ur.role_id
|
|
|
- left join sys_user_ext suse on suse.user_id = u.user_id and suse.del_flag='0'
|
|
|
|
|
|
|
+ left join sys_user_ext suse on suse.user_id = u.user_id and suse.del_flag = '0'
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
|
@@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
from sys_user u
|
|
from sys_user u
|
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
|
|
left join sys_company c on u.company_id = c.id
|
|
left join sys_company c on u.company_id = c.id
|
|
|
- left join sys_user_ext suse on suse.user_id = u.user_id
|
|
|
|
|
|
|
+ left join sys_user_ext suse on suse.user_id = u.user_id and suse.del_flag = '0'
|
|
|
LEFT JOIN customers_ext ce ON suse.org_code = ce.chains_code
|
|
LEFT JOIN customers_ext ce ON suse.org_code = ce.chains_code
|
|
|
where u.del_flag = '0'
|
|
where u.del_flag = '0'
|
|
|
<if test="loginName != null and loginName != ''">
|
|
<if test="loginName != null and loginName != ''">
|
|
@@ -219,7 +219,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="selectUserByLoginName" parameterType="String" resultMap="SysUserResult">
|
|
<select id="selectUserByLoginName" parameterType="String" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
<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' GROUP BY login_name
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectUserByIsManager" resultType="java.lang.String">
|
|
<select id="selectUserByIsManager" resultType="java.lang.String">
|
|
@@ -283,12 +283,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="selectUserByPhoneNumber" parameterType="String" resultMap="SysUserResult">
|
|
<select id="selectUserByPhoneNumber" parameterType="String" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
<include refid="selectUserVo"/>
|
|
|
- where u.phonenumber = #{phonenumber} and u.quit is null and u.del_flag ='0' and suse.del_flag ='0'
|
|
|
|
|
|
|
+ where u.phonenumber = #{phonenumber} and u.quit is null and u.del_flag ='0'
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
|
|
<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
<include refid="selectUserVo"/>
|
|
|
- where u.email = #{email} and u.del_flag='0' and u.quit is null and suse.del_flag ='0'
|
|
|
|
|
|
|
+ where u.email = #{email} and u.del_flag='0' and u.quit is null
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="checkLoginNameUnique" resultType="int">
|
|
<select id="checkLoginNameUnique" resultType="int">
|
|
@@ -305,7 +305,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
|
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
<include refid="selectUserVo"/>
|
|
|
- where u.user_id = #{userId} and u.del_flag='0' and u.quit is null and suse.del_flag ='0'
|
|
|
|
|
|
|
+ where u.user_id = #{userId} and u.del_flag='0' and u.quit is null
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<delete id="deleteUserById" parameterType="Long">
|
|
<delete id="deleteUserById" parameterType="Long">
|
|
@@ -487,26 +487,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="selectUserByEmplyeeId" parameterType="String" resultMap="SysUserResult">
|
|
<select id="selectUserByEmplyeeId" parameterType="String" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
<include refid="selectUserVo"/>
|
|
|
- where suse.sap_employee_id = #{emplyeeId} and suse.del_flag ='0'
|
|
|
|
|
|
|
+ where suse.sap_employee_id = #{emplyeeId}
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectLoginNamesByCostumerCode" resultType="java.util.Map" parameterType="String">
|
|
<select id="selectLoginNamesByCostumerCode" resultType="java.util.Map" parameterType="String">
|
|
|
select sue.org_code customer_code,GROUP_CONCAT(su.login_name SEPARATOR '|') touser from sys_user su
|
|
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
|
|
|
|
|
|
|
+ left join sys_user_ext sue on sue.user_id = su.user_id and sue.del_flag = '0'
|
|
|
where sue.org_code in
|
|
where sue.org_code in
|
|
|
<foreach collection="array" item="customerCode" open="(" separator="," close=")">
|
|
<foreach collection="array" item="customerCode" open="(" separator="," close=")">
|
|
|
#{customerCode}
|
|
#{customerCode}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
- and sue.is_customer_manager != 0 and su.quit is null and su.del_flag = '0' and sue.del_flag = '0'
|
|
|
|
|
|
|
+ and sue.is_customer_manager != 0 and su.quit is null and su.del_flag = '0'
|
|
|
GROUP BY sue.org_code
|
|
GROUP BY sue.org_code
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectLoginNamesByOrgCodeSelf" resultType="java.util.Map" parameterType="String">
|
|
<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
|
|
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 sue.del_flag = '0'
|
|
|
|
|
- and sue.org_code =#{customerCode}
|
|
|
|
|
|
|
+ left join sys_user_ext sue on sue.user_id = su.user_id and sue.del_flag = '0'
|
|
|
|
|
+ where sue.org_code =#{customerCode}
|
|
|
and sue.is_customer_manager in ('1','2','3')
|
|
and sue.is_customer_manager in ('1','2','3')
|
|
|
and sue.is_customer_manager != 0
|
|
and sue.is_customer_manager != 0
|
|
|
and su.quit is null
|
|
and su.quit is null
|
|
@@ -519,21 +518,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
u.login_name
|
|
u.login_name
|
|
|
FROM
|
|
FROM
|
|
|
order_sales_sum_tuc_customer c
|
|
order_sales_sum_tuc_customer c
|
|
|
- LEFT JOIN sys_user_ext e ON e.sap_employee_id = c.emp_id
|
|
|
|
|
|
|
+ LEFT JOIN sys_user_ext e ON e.sap_employee_id = c.emp_id and e.del_flag = '0'
|
|
|
LEFT JOIN sys_user u ON u.user_id = e.user_id
|
|
LEFT JOIN sys_user u ON u.user_id = e.user_id
|
|
|
WHERE
|
|
WHERE
|
|
|
c.customer_id =#{customerId}
|
|
c.customer_id =#{customerId}
|
|
|
and u.quit is null
|
|
and u.quit is null
|
|
|
and u.del_flag = '0'
|
|
and u.del_flag = '0'
|
|
|
- and e.del_flag = '0'
|
|
|
|
|
|
|
+
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
u.user_id limit 1
|
|
u.user_id limit 1
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectLoginNamesByCustomerModelVO" resultType="java.util.Map" parameterType="String">
|
|
<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
|
|
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 su.quit is null and su.del_flag = '0' and sue.del_flag = '0'
|
|
|
|
|
|
|
+ left join sys_user_ext sue on sue.user_id = su.user_id and sue.del_flag = '0'
|
|
|
|
|
+ where su.quit is null and su.del_flag = '0'
|
|
|
<if test="customerCode !=null and customerCode !='' ">
|
|
<if test="customerCode !=null and customerCode !='' ">
|
|
|
and sue.org_code =#{customerCode}
|
|
and sue.org_code =#{customerCode}
|
|
|
</if>
|
|
</if>
|
|
@@ -549,8 +548,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="selectLoginNamesByCostumerCode1" resultType="java.util.Map" parameterType="String">
|
|
<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
|
|
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 su.quit is null and su.del_flag = '0' and sue.del_flag = '0' and sue.org_code in
|
|
|
|
|
|
|
+ left join sys_user_ext sue on sue.user_id = su.user_id and sue.del_flag = '0'
|
|
|
|
|
+ where su.quit is null and su.del_flag = '0' and sue.org_code in
|
|
|
<foreach collection="array" item="customerCode" open="(" separator="," close=")">
|
|
<foreach collection="array" item="customerCode" open="(" separator="," close=")">
|
|
|
#{customerCode}
|
|
#{customerCode}
|
|
|
</foreach>
|
|
</foreach>
|
|
@@ -559,8 +558,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="selectLoginNamesByEmployeeCode" resultType="Map" parameterType="String">
|
|
<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
|
|
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 su.quit is null and su.del_flag = '0' and sue.del_flag = '0' and sue.sap_employee_id in
|
|
|
|
|
|
|
+ left join sys_user_ext sue on sue.user_id = su.user_id and sue.del_flag = '0'
|
|
|
|
|
+ where su.quit is null and su.del_flag = '0' and sue.sap_employee_id in
|
|
|
<foreach collection="array" item="employeeCode" open="(" separator="," close=")">
|
|
<foreach collection="array" item="employeeCode" open="(" separator="," close=")">
|
|
|
#{employeeCode}
|
|
#{employeeCode}
|
|
|
</foreach>
|
|
</foreach>
|
|
@@ -578,10 +577,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
v.org_code
|
|
v.org_code
|
|
|
FROM
|
|
FROM
|
|
|
sys_user u
|
|
sys_user u
|
|
|
- LEFT JOIN sys_user_ext v ON u.user_id = v.user_id
|
|
|
|
|
|
|
+ LEFT JOIN sys_user_ext v ON u.user_id = v.user_id and v.del_flag = '0'
|
|
|
left join sys_user_customer_authorization a on a.user_id = u.user_id
|
|
left join sys_user_customer_authorization a on a.user_id = u.user_id
|
|
|
WHERE
|
|
WHERE
|
|
|
- v.org_code =#{orgCode} and u.quit is null and u.del_flag = '0' and v.del_flag = '0'
|
|
|
|
|
|
|
+ v.org_code =#{orgCode} and u.quit is null and u.del_flag = '0'
|
|
|
and v.is_customer_manager !='0' and v.is_customer_manager !='8' GROUP BY u.user_id
|
|
and v.is_customer_manager !='0' and v.is_customer_manager !='8' GROUP BY u.user_id
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
@@ -616,7 +615,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="sendmailUnionUser" resultType="com.dgtly.system.domain.UserVO" >
|
|
<select id="sendmailUnionUser" resultType="com.dgtly.system.domain.UserVO" >
|
|
|
select u.user_name as userName,u.phonenumber,u.login_name as loginName
|
|
select u.user_name as userName,u.phonenumber,u.login_name as loginName
|
|
|
- from sys_user u LEFT JOIN sys_user_ext e on e.user_id =u.user_id WHERE
|
|
|
|
|
|
|
+ from sys_user u LEFT JOIN sys_user_ext e on e.user_id =u.user_id and e.del_flag = '0' WHERE
|
|
|
( u.phonenumber, u.user_name ) IN (
|
|
( u.phonenumber, u.user_name ) IN (
|
|
|
SELECT
|
|
SELECT
|
|
|
phonenumber,
|
|
phonenumber,
|
|
@@ -627,7 +626,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
phonenumber,
|
|
phonenumber,
|
|
|
user_name
|
|
user_name
|
|
|
HAVING
|
|
HAVING
|
|
|
- count(*) > 1) and u.del_flag = '0' and u.quit is null and e.del_flag = '0'
|
|
|
|
|
|
|
+ count(*) > 1) and u.del_flag = '0' and u.quit is null
|
|
|
and e.is_customer_manager is null order by user_name
|
|
and e.is_customer_manager is null order by user_name
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
@@ -635,8 +634,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
SELECT *
|
|
SELECT *
|
|
|
FROM
|
|
FROM
|
|
|
sys_user u
|
|
sys_user u
|
|
|
- LEFT JOIN sys_user_ext suse ON suse.user_id = u.user_id
|
|
|
|
|
|
|
+ LEFT JOIN sys_user_ext suse ON suse.user_id = u.user_id and suse.del_flag = '0'
|
|
|
where u.user_id = #{userId}
|
|
where u.user_id = #{userId}
|
|
|
- and u.del_flag = '0' and u.quit is null and suse.del_flag = '0'
|
|
|
|
|
|
|
+ and u.del_flag = '0' and u.quit is null
|
|
|
</select>
|
|
</select>
|
|
|
</mapper>
|
|
</mapper>
|