| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?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.management.platform.mapper.ParticipationMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.management.platform.entity.Participation">
- <id column="id" property="id"/>
- <result column="user_id" property="userId"/>
- <result column="project_id" property="projectId"/>
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, user_id, project_id
- </sql>
- <delete id="deleteBatchByUserId">
- delete from participation where user_id in
- <foreach collection="userIds" item="userId" separator="," open="(" close=")">
- #{userId}
- </foreach>
- </delete>
- <!--根据项目id获取所有参与者id和name-->
- <select id="getParticipator" resultType="java.util.Map">
- SELECT a.user_id AS id,b.job_number AS jobNumber, b.name
- FROM participation a
- LEFT JOIN user b ON a.user_id = b.id
- WHERE a.project_id = #{projectId}
- </select>
- <select id="getAllParticipator" resultType="com.management.platform.entity.ParticipationUser">
- SELECT a.user_id AS id,b.corpwx_userid as corpwxUserId, b.name,a.project_id as projectId
- FROM participation a
- LEFT JOIN user b ON a.user_id = b.id
- WHERE b.company_id = #{companyId}
- <if test="projectIdList != null">
- and a.project_id in
- <foreach collection="projectIdList" open="(" close=")" separator="," item="item">
- #{item}
- </foreach>
- </if>
- <if test="projectIdList==null">
- ORDER BY a.project_id,a.id
- </if>
- </select>
- </mapper>
|