| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?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.TaskRestartMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.management.platform.entity.TaskRestart">
- <id column="id" property="id" />
- <result column="task_id" property="taskId" />
- <result column="operator_id" property="operatorId" />
- <result column="restart_date" property="restartDate" />
- <result column="restart_reason" property="restartReason" />
- <result column="task_comment_id" property="taskCommentId" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, task_id, operator_id, restart_date, restart_reason, task_comment_id
- </sql>
- <select id="getTaskRestartList" resultType="java.util.Map">
- select c.project_name as projectName,c.project_code as projectCode,b.name as taskName,a.restart_reason as restartReason,date_format(a.restart_date,'%Y-%m-%d %H:%i:%s') as restartDate,GROUP_CONCAT(d.person_liable_id) as personLiableIds from task_restart a
- left join task b on b.id=a.task_id
- left join project c on c.id=b.project_id
- left join task_person_liable d on d.task_id=a.task_id
- <if test="personLiableId!=null and personLiableId!=''">
- left join task_person_liable d2 on d2.task_id=a.task_id
- </if>
- where c.company_id=#{companyId}
- <if test="startDate!=null and endDate!=null">
- and a.restart_date between #{startDate} and #{endDate}
- </if>
- <if test="inchargerId!=null">
- and c.incharger_id=#{inchargerId}
- </if>
- <if test="personLiableId!=null and personLiableId!=''">
- and d2.person_liable_id=#{personLiableId}
- </if>
- <if test="projectId!=null and projectId!=''">
- and c.id=#{projectId}
- </if>
- group by a.id
- <if test="start!=null and size!=null">
- limit #{start},#{size}
- </if>
- </select>
- <select id="getTaskRestartCount" resultType="java.lang.Long">
- select count(1) from (select c.project_name as projectName,c.project_code as projectCode,b.name as taskName,a.restart_reason as restartReason,date_format(a.restart_date,'%Y-%m-%d %H:%i:%s') as restartDate,GROUP_CONCAT(d.person_liable_id) as personLiableIds from task_restart a
- left join task b on b.id=a.task_id
- left join project c on c.id=b.project_id
- left join task_person_liable d on d.task_id=a.task_id
- <if test="personLiableId!=null and personLiableId!=''">
- left join task_person_liable d2 on d2.task_id=a.task_id
- </if>
- where c.company_id=#{companyId}
- <if test="startDate!=null and endDate!=null">
- and a.restart_date between #{startDate} and #{endDate}
- </if>
- <if test="inchargerId!=null">
- and c.incharger_id=#{inchargerId}
- </if>
- <if test="personLiableId!=null and personLiableId!=''">
- and d2.person_liable_id=#{personLiableId}
- </if>
- <if test="projectId!=null and projectId!=''">
- and c.id=#{projectId}
- </if>
- group by a.id) as total
- </select>
- </mapper>
|