You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

45 lines
1.7 KiB

<?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"/>
</collection>
</resultMap>
<select id="selectById" resultMap="ii">
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
FROM
t_pro_task_detail tptd,
t_pro_task_sub_time tptst
WHERE
tptd.`level` = 2
AND tptd.rec_status = 0
AND tptd.executor_role IN (
SELECT
tpmr.role_id
FROM
t_pro_member_role tpmr
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 )
)
AND tptst.task_detail_id = tptd.id
and tptst.begin_time&lt;= #{param.startTime}
and tptst.end_time &gt;= #{param.endTime}
<if test="param.id != null">
and tptd.project_id=#{param.id}
</if>
</select>
</mapper>