123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?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="org.springblade.manager.mapper.SaveUserInfoByProjectMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="contractInfoResultMap" type="org.springblade.manager.dto.SaveUserInfoByProjectDTO">
- <result column="id" property="id"/>
- <result column="project_id" property="projectId"/>
- <result column="contract_id" property="contractId"/>
- <result column="role_id" property="roleId"/>
- <result column="post_id" property="postId"/>
- <result column="user_id" property="userId"/>
- <result column="create_time" property="createTime"/>
- <result column="create_user" property="createUser"/>
- <result column="create_dept" property="createDept"/>
- <result column="update_user" property="updateUser"/>
- <result column="update_time" property="updateTime"/>
- <result column="status" property="status"/>
- <result column="is_deleted" property="isDeleted"/>
- </resultMap>
- <resultMap id="queryUserMap" type="org.springblade.system.user.entity.User">
- <result column="id" property="id"/>
- <result column="name" property="name"/>
- <result column="real_name" property="realName"/>
- </resultMap>
- <update id="deleteByIds">
- UPDATE m_project_assignment_user SET is_deleted = 1
- WHERE id in
- <foreach collection="idsList" item="idsList" open="(" close=")" separator=",">
- #{idsList}
- </foreach>
- </update>
- <update id="updateUserRoleIdById">
- UPDATE blade_user
- SET role_id = #{roleIds}
- WHERE id = #{userId}
- </update>
- <delete id="deleteByCondition">
- DELETE
- FROM m_project_assignment_user
- WHERE project_id = #{projectId}
- AND user_id = #{userId}
- </delete>
- <delete id="deleteByIdsPhysical">
- DELETE FROM m_project_assignment_user
- WHERE id in
- <foreach collection="idsList" item="idsList" open="(" close=")" separator=",">
- #{idsList}
- </foreach>
- </delete>
- <select id="findMaintenanceUser" resultMap="queryUserMap">
- select bu.id,
- bu.name,
- bu.real_name
- from blade_user AS bu
- left join (
- select pau.user_id
- from m_project_assignment_user AS pau
- left join blade_role AS br on pau.role_id = br.id
- where pau.is_deleted = 0
- and br.id is null
- group by pau.user_id
- ) as pau on bu.id = pau.user_id
- </select>
- <select id="queryCurrentUserDownAllContractAndProjectId" resultMap="contractInfoResultMap">
- select project_id, contract_id
- from m_project_assignment_user
- where is_deleted = 0
- and user_id = #{userId}
- </select>
- <select id="queryProjectBusinessUser" resultMap="contractInfoResultMap">
- select
- pau.*
- from m_project_assignment_user AS pau
- LEFT JOIN blade_role AS br ON pau.role_id = br.id
- where
- pau.is_deleted = 0
- <if test="projectId != null">
- and pau.project_id = #{projectId}
- </if>
- <if test="contractId != null">
- and pau.contract_id = #{contractId}
- </if>
- <if test="projectId != null and contractId != null">
- AND br.id is null
- </if>
- </select>
- <select id="selectByIds" resultType="org.springblade.manager.dto.SaveUserInfoByProjectDTO">
- SELECT u.user_id,u.role_id FROM m_project_assignment_user u
- WHERE id in
- <foreach collection="idsList" item="idsList" open="(" close=")" separator=",">
- #{idsList}
- </foreach>
- </select>
- <select id="selectSGJL" resultType="java.lang.Integer">
- select count(*) from m_contract_relation_jlyz where contract_id_jlyz = #{ids}
- </select>
- </mapper>
|