10 changed files with 235 additions and 43 deletions
@ -1,5 +1,5 @@ |
|||
spring: |
|||
profiles: |
|||
active: test |
|||
include: util-test,common |
|||
active: dev |
|||
include: util-dev,common |
|||
|
|||
|
@ -1,45 +1,90 @@ |
|||
<?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.ccsens.tall.persist.dao.IInputDocDao"> |
|||
<resultMap id="ii" type="com.ccsens.tall.bean.vo.LwbsVo$SelByProjectIdToTasksVo"> |
|||
<id property="id" column="id"/> |
|||
<result property="name" column="name"/> |
|||
<collection property="list" ofType="com.ccsens.tall.bean.vo.LwbsVo$SelByProjectIdToTaskVo"> |
|||
<result column="beginTime" property="startTime"/> |
|||
<result column="endTime" property="endTime"/> |
|||
<result column="cha" property="cha"/> |
|||
<result column="milestone" property="milestone"/> |
|||
<resultMap id="ass" type="com.ccsens.tall.bean.vo.TaskVo$NormalTask"> |
|||
<id property="projectId" column="pId"/> |
|||
<result property="projectName" column="pName"/> |
|||
<result property="description" column="pDescription"/> |
|||
<result property="beginTime" column="pBeginTime"/> |
|||
<result property="endTime" column="pEndTime"/> |
|||
<result property="duration" column="pDuration"/> |
|||
<collection property="secondTasks" ofType="com.ccsens.tall.bean.vo.TaskVo$NormalTask"> |
|||
<result property="detailId" column="task_id"/> |
|||
<result property="id" column="times_id"/> |
|||
<result property="name" column="name"/> |
|||
<result property="description" column="description"/> |
|||
<result property="beginTime" column="begin_time_sub_time"/> |
|||
<result property="endTime" column="end_time_sub_time"/> |
|||
<result property="duration" column="duration"/> |
|||
<result property="cycle" column="cycle"/> |
|||
<result property="priority" column="priority"/> |
|||
<result property="milestone" column="milestone"/> |
|||
<result property="hasGroup" column="has_group"/> |
|||
</collection> |
|||
</resultMap> |
|||
<select id="selectById" resultMap="ii"> |
|||
<select id="selectByCompany" resultMap="ass"> |
|||
SELECT |
|||
tptd.project_id AS id, |
|||
tptd.`name`, |
|||
tptd.description, |
|||
tptst.begin_time as beginTime, |
|||
tptst.end_time as endTime, |
|||
( tptst.end_time - tptst.begin_time ) / 1000 / 3600 AS cha, |
|||
tptd.milestone |
|||
tsp.id AS pId, |
|||
tsp.`name` AS pName, |
|||
tsp.description AS pDescription, |
|||
tsp.begin_time as pBeginTime, |
|||
tsp.end_time as pEndTime, |
|||
(tsp.end_time-tsp.begin_time)/1000/3600 as pDuration, |
|||
tptdt.id as task_id, |
|||
tptdt.name, |
|||
tptdt.description, |
|||
tptdt.begin_time_sub_time, |
|||
tptdt.end_time_sub_time, |
|||
(tptdt.end_time_sub_time-tptdt.begin_time_sub_time)/1000/3600 as duration, |
|||
tptdt.cycle, |
|||
tptdt.priority, |
|||
tptdt.milestone, |
|||
tptdt.has_group, |
|||
tptdt.times_id |
|||
FROM |
|||
t_pro_task_detail tptd, |
|||
t_pro_task_sub_time tptst |
|||
t_sys_project tsp |
|||
INNER JOIN t_pro_member tpm ON tpm.project_id = tsp.id AND tpm.user_id = #{userId} and tpm.rec_status=0 |
|||
<if test="param.id!=null"> |
|||
and tpm.project_id=#{param.id} |
|||
</if> |
|||
LEFT JOIN ( |
|||
SELECT |
|||
tptd.*, |
|||
tptst.begin_time AS begin_time_sub_time, |
|||
tptst.end_time AS end_time_sub_time, |
|||
tptst.id as times_id |
|||
FROM |
|||
t_pro_task_detail tptd |
|||
LEFT JOIN t_pro_task_sub_time tptst ON tptd.id = tptst.task_detail_id |
|||
AND tptst.rec_status = 0 |
|||
WHERE |
|||
tptd.`level` = 2 |
|||
AND tptd.rec_status = 0 |
|||
tptd.rec_status = 0 |
|||
AND tptd.`level` = 2 |
|||
AND tptst.begin_time <= #{param.endTime} AND tptst.end_time >= #{param.startTime} |
|||
AND tptd.executor_role IN ( |
|||
SELECT |
|||
tpmr.role_id |
|||
FROM |
|||
t_pro_member_role tpmr |
|||
t_pro_member_role tpmr, |
|||
t_pro_member tpm |
|||
WHERE |
|||
tpmr.rec_status = 0 |
|||
AND tpmr.member_id IN ( SELECT id FROM t_pro_member tpm WHERE tpm.user_id = #{userId} AND tpm.rec_status = 0 ) |
|||
tpm.rec_status = 0 |
|||
AND tpmr.rec_status = 0 |
|||
AND tpm.user_id = #{userId} UNION |
|||
SELECT |
|||
tpr.id |
|||
FROM |
|||
t_pro_role tpr |
|||
WHERE |
|||
tpr.rec_status = 0 |
|||
AND tpr.NAME = '全体成员' |
|||
) |
|||
AND tptst.task_detail_id = tptd.id |
|||
and tptst.begin_time<= #{param.startTime} |
|||
and tptst.end_time >= #{param.endTime} |
|||
<if test="param.id != null"> |
|||
and tptd.project_id=#{param.id} |
|||
) tptdt ON tptdt.project_id = tsp.id |
|||
WHERE |
|||
tsp.rec_status = 0 |
|||
AND tsp.begin_time <= #{param.endTime} AND tsp.end_time >= #{param.startTime} |
|||
<if test="param.id!=null"> |
|||
and tsp.id =#{param.id} |
|||
</if> |
|||
</select> |
|||
</mapper> |
Loading…
Reference in new issue