|
@@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
|
|
|
|
|
</resultMap>
|
|
|
-
|
|
|
+
|
|
|
<resultMap id="deptResult" type="SysDept">
|
|
|
<id property="deptId" column="dept_id" />
|
|
|
<result property="parentId" column="parent_id" />
|
|
@@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<id property="id" column="id" />
|
|
|
<result property="companyName" column="company_name" />
|
|
|
</resultMap>
|
|
|
-
|
|
|
+
|
|
|
<resultMap id="RoleResult" type="SysRole">
|
|
|
<id property="roleId" column="role_id" />
|
|
|
<result property="roleName" column="role_name" />
|
|
@@ -87,7 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="postCode" column="post_code" />
|
|
|
<result property="identity" column="identity" />
|
|
|
</resultMap>
|
|
|
-
|
|
|
+
|
|
|
<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,
|
|
@@ -103,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
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
|
|
|
</sql>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
|
|
select u.user_id,u.company_id, u.dept_id, u.login_name, u.user_name,u.id_type,u.id_number,u.account_id,u.is_authentication,u.receive_url_mobile_no, u.email, u.avatar,
|
|
|
u.phonenumber, u.password, u.sex, u.salt, u.status, u.del_flag,u.quit,u.is_independently,u.is_self_delivery,
|
|
@@ -172,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
|
|
select distinct u.user_id,u.company_id, u.dept_id,u.id_type,u.id_number,u.account_id,u.is_authentication,u.receive_url_mobile_no, u.login_name, u.user_name, u.email, u.avatar, u.phonenumber, u.status, u.create_time
|
|
|
from sys_user u
|
|
@@ -193,7 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
|
|
select distinct u.user_id,u.company_id,u.id_type,u.id_number,u.account_id,u.is_authentication,u.receive_url_mobile_no, u.dept_id, u.login_name, u.user_name, u.email, u.avatar, u.phonenumber, u.status, u.create_time
|
|
|
from sys_user u
|
|
@@ -215,7 +215,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectUserByLoginName" parameterType="String" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
|
where u.login_name = #{userName} and u.quit is null GROUP BY login_name
|
|
@@ -279,34 +279,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN sys_user_ext suse ON suse.user_id = u.user_id
|
|
|
where suse.is_customer_manager is not null and suse.is_customer_manager !=''
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectUserByPhoneNumber" parameterType="String" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
|
where u.phonenumber = #{phonenumber}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
|
|
|
<include refid="selectUserVo"/>
|
|
|
where u.email = #{email} and del_flag='0' and quit is null
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="checkLoginNameUnique" resultType="int">
|
|
|
select count(1) from sys_user where login_name=#{loginName} and del_flag='0' and quit is null
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="checkPhoneUnique" resultMap="SysUserResult">
|
|
|
select user_id, phonenumber from sys_user where phonenumber=#{phonenumber} and del_flag='0' and quit is null
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="checkEmailUnique" resultMap="SysUserResult">
|
|
|
select user_id, email from sys_user where email=#{email} and del_flag='0' and quit is null
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<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
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<delete id="deleteUserById" parameterType="Long">
|
|
|
delete from sys_user where user_id = #{userId}
|
|
|
</delete>
|
|
@@ -314,14 +314,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<delete id="deleteUserByLoginName" parameterType="Long">
|
|
|
delete from sys_user where login_name = #{loginName}
|
|
|
</delete>
|
|
|
-
|
|
|
+
|
|
|
<delete id="deleteUserByIds" parameterType="Long">
|
|
|
update sys_user set del_flag = '2' where user_id in
|
|
|
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
|
|
#{userId}
|
|
|
- </foreach>
|
|
|
+ </foreach>
|
|
|
</delete>
|
|
|
-
|
|
|
+
|
|
|
<update id="updateUser" parameterType="SysUser">
|
|
|
update sys_user
|
|
|
<set>
|
|
@@ -398,7 +398,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="status == 0 ">and del_flag = 3 </if>
|
|
|
<if test="status == 3 ">and del_flag = 0 </if>
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
|
|
<selectKey keyProperty="userId" order="AFTER" resultType="java.lang.Long">
|
|
|
select LAST_INSERT_ID();
|
|
@@ -564,18 +564,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
SELECT
|
|
|
u.user_id,
|
|
|
u.user_name,
|
|
|
- u.is_consignee,
|
|
|
- u.is_independently,
|
|
|
- u.is_self_delivery,
|
|
|
+ a.is_consignee,
|
|
|
+ a.is_independently,
|
|
|
+ a.is_self_delivery,
|
|
|
v.sap_employee_id,
|
|
|
v.is_customer_manager,
|
|
|
v.org_code
|
|
|
FROM
|
|
|
sys_user u
|
|
|
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
|
|
|
- and v.is_customer_manager !='0' and v.is_customer_manager !='8'
|
|
|
+ and v.is_customer_manager !='0' and v.is_customer_manager !='8' GROUP BY u.user_id
|
|
|
</select>
|
|
|
|
|
|
<select id="getCustomNameByCode" resultType="java.lang.String" >
|
|
@@ -623,4 +624,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
count(*) > 1) and u.del_flag=0 and u.quit is null
|
|
|
and e.is_customer_manager is null order by user_name
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+</mapper>
|