1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.diagbot.mapper.UserInfoMapper">
- <select id="selectUserInfoPage" parameterType="com.diagbot.entity.UserInfo" resultType="com.diagbot.entity.UserInfo">
- SELECT
- u.id AS userId,
- u.gmt_create as userGmtCreate,
- u.username as userName,
- u.linkman as linKman,
- u.email as email,
- org.id AS orgId,
- org.gmt_create as orgGmtCreate,
- org.name as orgName
- FROM sys_user u
- LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
- LEFT JOIN sys_organization org ON uorg.organization_id = org.id
- WHERE u.is_deleted = 'N' AND u.TYPE = "0" ORDER BY u.gmt_create DESC
- </select>
- <select id="selectUserInfoListPage" resultType="com.diagbot.entity.UserInfo">
- SELECT
- u.id AS userId,
- u.gmt_create AS userGmtCreate,
- u.username AS userName,
- u.linkman AS linKman,
- u.email AS email,
- org.id AS orgId,
- org.gmt_create AS orgGmtCreate,
- org.name AS orgName,
- org.type as orgType,
- org.principal AS orgPrincipal,
- org.address as orgAddress,
- org.parent_id as orgParent_id,
- org.sub_num as orgSub_num,
- aut.position as autPosition,
- aut.is_reject as autIsReject,
- aut.status as autStatus
- FROM sys_user u
- LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
- LEFT JOIN sys_organization org ON uorg.organization_id = org.id
- LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
- WHERE u.is_deleted = 'N' AND u.TYPE = "0"
- <if test="userInfo.orgName != null">
- AND org.name LIKE CONCAT('%', #{userInfo.orgName}, '%')
- </if>
- <if test="userInfo.autStatus != null">
- AND aut.status = #{userInfo.autStatus}
- </if>
- ORDER BY u.gmt_create DESC
- </select>
-
- <update id="updateUserInfoAll" parameterType="java.util.Map" >
- UPDATE sys_user u ,sys_user_organization a ,
- sys_organization b ,sys_user_authentication c
- SET
- <if test="isDeleted !=null">
- u.is_deleted = #{isDeleted},a.is_deleted= #{isDeleted},b.is_deleted= #{isDeleted},c.is_deleted= #{isDeleted},
- </if>
- <if test="email != null">
- u.gmt_modified=#{gmtModified},u.modifier=#{modifier},
- u.email=#{email},
- </if>
- <if test="principal != null || address != null || type != null">
- b.gmt_modified=#{gmtModified},b.modifier=#{modifier},
- b.principal=#{principal},b.address=#{address},b.type=#{type}
- </if>
- <if test="position != null ||">
- c.gmt_modified=#{gmtModified},c.modifier=#{modifier},
- c.position=#{position},c.is_reject=#{isReject},c.reject_type=#{rejectType},
- c.reject_comment=#{rejectComment},c.status = #{status}
- </if>
- WHERE u.id = #{userId}
- AND c.user_id= #{userId}
- AND a.user_id = #{userId}
- AND a.organization_id =b.id
- </update>
- </mapper>
|