|
@@ -17,6 +17,18 @@
|
|
|
<result column="type" property="type" />
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap id="UserOrgDTO" type="com.diagbot.dto.UserOrgDTO">
|
|
|
+ <id column="user_id" property="userId" />
|
|
|
+ <result column="username" property="username" />
|
|
|
+ <result column="linkman" property="linkman" />
|
|
|
+ <result column="email" property="email" />
|
|
|
+ <result column="org_id" property="orgId" />
|
|
|
+ <result column="org_name" property="orgName" />
|
|
|
+ <result column="is_reject" property="isReject" />
|
|
|
+ <result column="au_status" property="auStatus" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
<select id="findByName" resultMap="BaseResultMap" parameterType="java.lang.String">
|
|
|
select * from sys_user
|
|
|
where username = #{username} and is_deleted = 'N'
|
|
@@ -44,6 +56,28 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getByIds" resultMap="BaseResultMap">
|
|
|
+ select u.* from sys_user u where u.is_deleted = 'N'
|
|
|
+ and u.id in
|
|
|
+ <foreach collection="list" item="ids" open="(" close=")" separator=",">
|
|
|
+ #{ids}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getUserOrgDTOByIds" resultMap="UserOrgDTO">
|
|
|
+ select u.id user_id ,u.username username, u.email email, u.linkman linkman , org.id org_id, org.name org_name, ua.is_reject is_reject, ua.status au_status
|
|
|
+ from sys_user u, sys_user_organization uo, sys_organization org , sys_user_authentication ua
|
|
|
+ where u.is_deleted = 'N' and uo.is_deleted = 'N' and org.is_deleted = 'N'
|
|
|
+ and u.id = uo.user_id and uo.organization_id = org.id and u.id = ua.user_id
|
|
|
+ and u.id in
|
|
|
+ <foreach collection="list" item="ids" open="(" close=")" separator=",">
|
|
|
+ #{ids}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
<!-- <select id="selectUserInfoListPage" resultMap="BaseResultMap">
|
|
|
select u.*
|
|
@@ -102,84 +136,84 @@
|
|
|
</select>
|
|
|
|
|
|
<update id="updateUserInfoAll" parameterType="com.diagbot.vo.UserInfoOrganizationsVO" >
|
|
|
- UPDATE sys_user u ,sys_user_organization a ,
|
|
|
- sys_organization b ,sys_user_authentication c
|
|
|
- SET u.remark = "0"
|
|
|
- <if test="email != null">
|
|
|
- <if test="gmtModified !=null">
|
|
|
- ,u.gmt_modified=#{gmtModified}
|
|
|
- </if>
|
|
|
- <if test="modifier != modifier">
|
|
|
- ,u.modifier=#{modifier}
|
|
|
- </if>
|
|
|
- ,u.email=#{email}
|
|
|
- </if>
|
|
|
- <if test="principal != null || address != null || type != null">
|
|
|
- <if test="gmtModified !=null">
|
|
|
- ,b.gmt_modified=#{gmtModified}
|
|
|
- </if>
|
|
|
- <if test="modifier != null">
|
|
|
- ,b.modifier=#{modifier}
|
|
|
- </if>
|
|
|
- <if test="principal != null">
|
|
|
- ,b.principal=#{principal}
|
|
|
- </if>
|
|
|
- <if test="address != null">
|
|
|
- ,b.address=#{address}
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- ,b.type=#{type}
|
|
|
- </if>
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="position != null || isReject != null || rejectType !=null || rejectComment !=null || status != null">
|
|
|
- <if test="gmtModified !=null">
|
|
|
- ,c.gmt_modified=#{gmtModified}
|
|
|
- </if>
|
|
|
- <if test="modifier != null">
|
|
|
- ,c.modifier=#{modifier}
|
|
|
- </if>
|
|
|
- <if test="position != null">
|
|
|
- ,c.position=#{position}
|
|
|
+ UPDATE sys_user u ,sys_user_organization a ,
|
|
|
+ sys_organization b ,sys_user_authentication c
|
|
|
+ SET u.remark = "0"
|
|
|
+ <if test="email != null">
|
|
|
+ <if test="gmtModified !=null">
|
|
|
+ ,u.gmt_modified=#{gmtModified}
|
|
|
+ </if>
|
|
|
+ <if test="modifier != modifier">
|
|
|
+ ,u.modifier=#{modifier}
|
|
|
+ </if>
|
|
|
+ ,u.email=#{email}
|
|
|
</if>
|
|
|
- <if test="isReject != null">
|
|
|
- ,c.is_reject=#{isReject}
|
|
|
+ <if test="principal != null || address != null || type != null">
|
|
|
+ <if test="gmtModified !=null">
|
|
|
+ ,b.gmt_modified=#{gmtModified}
|
|
|
+ </if>
|
|
|
+ <if test="modifier != null">
|
|
|
+ ,b.modifier=#{modifier}
|
|
|
+ </if>
|
|
|
+ <if test="principal != null">
|
|
|
+ ,b.principal=#{principal}
|
|
|
+ </if>
|
|
|
+ <if test="address != null">
|
|
|
+ ,b.address=#{address}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ ,b.type=#{type}
|
|
|
+ </if>
|
|
|
</if>
|
|
|
- <if test="rejectType !=null">
|
|
|
- ,c.reject_type=#{rejectType}
|
|
|
+
|
|
|
+ <if test="position != null || isReject != null || rejectType !=null || rejectComment !=null || status != null">
|
|
|
+ <if test="gmtModified !=null">
|
|
|
+ ,c.gmt_modified=#{gmtModified}
|
|
|
+ </if>
|
|
|
+ <if test="modifier != null">
|
|
|
+ ,c.modifier=#{modifier}
|
|
|
+ </if>
|
|
|
+ <if test="position != null">
|
|
|
+ ,c.position=#{position}
|
|
|
+ </if>
|
|
|
+ <if test="isReject != null">
|
|
|
+ ,c.is_reject=#{isReject}
|
|
|
+ </if>
|
|
|
+ <if test="rejectType !=null">
|
|
|
+ ,c.reject_type=#{rejectType}
|
|
|
+ </if>
|
|
|
+ <if test="rejectComment !=null">
|
|
|
+ ,c.reject_comment=#{rejectComment}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ ,c.status = #{status}
|
|
|
+ </if>
|
|
|
</if>
|
|
|
- <if test="rejectComment !=null">
|
|
|
- ,c.reject_comment=#{rejectComment}
|
|
|
+ WHERE u.id = #{userId}
|
|
|
+ AND c.user_id= #{userId}
|
|
|
+ AND a.user_id = #{userId}
|
|
|
+ AND a.organization_id =b.id
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateDeleted" parameterType="java.util.Map">
|
|
|
+ UPDATE sys_user u ,sys_user_organization a ,
|
|
|
+ sys_organization b,sys_user_authentication c
|
|
|
+ SET u.is_deleted = "Y",a.is_deleted= "Y",b.is_deleted= "Y",c.is_deleted="Y"
|
|
|
+ <if test="map.gmtModified !=null">
|
|
|
+ ,u.gmt_modified=#{map.gmtModified}
|
|
|
+ ,b.gmt_modified=#{map.gmtModified}
|
|
|
+ ,c.gmt_modified=#{map.gmtModified}
|
|
|
</if>
|
|
|
- <if test="status != null">
|
|
|
- ,c.status = #{status}
|
|
|
+ <if test="map.modifier != null">
|
|
|
+ ,u.modifier=#{map.modifier}
|
|
|
+ ,b.modifier=#{map.modifier}
|
|
|
+ ,c.modifier=#{map.modifier}
|
|
|
</if>
|
|
|
- </if>
|
|
|
- WHERE u.id = #{userId}
|
|
|
- AND c.user_id= #{userId}
|
|
|
- AND a.user_id = #{userId}
|
|
|
- AND a.organization_id =b.id
|
|
|
-</update>
|
|
|
-
|
|
|
- <update id="updateDeleted" parameterType="java.util.Map">
|
|
|
- UPDATE sys_user u ,sys_user_organization a ,
|
|
|
- sys_organization b,sys_user_authentication c
|
|
|
- SET u.is_deleted = "Y",a.is_deleted= "Y",b.is_deleted= "Y",c.is_deleted="Y"
|
|
|
- <if test="map.gmtModified !=null">
|
|
|
- ,u.gmt_modified=#{map.gmtModified}
|
|
|
- ,b.gmt_modified=#{map.gmtModified}
|
|
|
- ,c.gmt_modified=#{map.gmtModified}
|
|
|
- </if>
|
|
|
- <if test="map.modifier != null">
|
|
|
- ,u.modifier=#{map.modifier}
|
|
|
- ,b.modifier=#{map.modifier}
|
|
|
- ,c.modifier=#{map.modifier}
|
|
|
- </if>
|
|
|
- WHERE u.id = #{map.userId}
|
|
|
- AND c.user_id= #{map.userId}
|
|
|
- AND a.user_id = #{map.userId}
|
|
|
- AND a.organization_id =b.id
|
|
|
-</update>
|
|
|
+ WHERE u.id = #{map.userId}
|
|
|
+ AND c.user_id= #{map.userId}
|
|
|
+ AND a.user_id = #{map.userId}
|
|
|
+ AND a.organization_id =b.id
|
|
|
+ </update>
|
|
|
|
|
|
|
|
|
</mapper>
|