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.
 
 

157 lines
6.3 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.TaskDeliverDao">
<resultMap id="resultMap_DeliverInfo" type="com.ccsens.tall.bean.vo.ProjectVo$DeliverInfo">
<id column="dId" property="id"/>
<result column="dName" property="name"/>
<result column="cfUrl" property="url"/>
<result column="dUpload" property="upload"/>
<result column="dFinals" property="finals"/>
</resultMap>
<resultMap id="DeliverChecklist" type="com.ccsens.tall.bean.vo.DeliverVo$DeliverFile">
<id column="dId" property="id"/>
<result column="dName" property="name"/>
<collection property="project" ofType="com.ccsens.tall.bean.vo.DeliverVo$DProject">
<id column="sId" property="id"/>
<result column="sName" property="name"/>
</collection>
<collection property="role" ofType="com.ccsens.tall.bean.vo.DeliverVo$DRole">
<id column="rId" property="id"/>
<result column="rName" property="name"/>
</collection>
<collection property="task" ofType="com.ccsens.tall.bean.vo.DeliverVo$DTask">
<id column="tId" property="id"/>
<result column="tName" property="name"/>
<result column="tBeginTime" property="beginTime"/>
<result column="tEndTime" property="endTime"/>
</collection>
<collection property="file" ofType="com.ccsens.tall.bean.vo.DeliverVo$DFile">
<id column="fId" property="id"/>
<result column="fName" property="name"/>
<result column="fUrl" property="url"/>
</collection>
</resultMap>
<resultMap id="resultMap_FilePath" type="com.ccsens.tall.bean.vo.DeliverVo$FilePath">
<id column="fileId" property="fileId"/>
<id column="postLogId" property="postLogId"/>
<result column="description" property="description"/>
<result column="url" property="url"/>
<result column="uploadTime" property="time"/>
<result column="deleteTime" property="deleteTime"/>
<result column="history" property="isHistory"/>
<result column="userId" property="uploaderId"/>
</resultMap>
<resultMap id="deliverInfo" type="com.ccsens.tall.bean.vo.DeliverVo$DeliverInfo">
<id column="deliverId" property="deliverId"/>
<result column="deliverName" property="deliverName"/>
<collection property="fileList" ofType="com.ccsens.tall.bean.vo.DeliverVo$FilePath">
<id column="fileId" property="fileId"/>
<result column="description" property="description"/>
<result column="uploadTime" property="time"/>
<result column="path" property="url"/>
<result column="isHistory" property="isHistory"/>
<result column="uploaderId" property="uploaderId"/>
<collection property="checkerList" ofType="com.ccsens.tall.bean.vo.DeliverVo$Checker">
<result column="checkerId" property="checkerId"/>
<result column="checkerStatus" property="checkerStatus"/>
<result column="remark" property="remark"/>
</collection>
</collection>
</resultMap>
<select id="selectBySubTimeId" parameterType="java.util.Map" resultMap="deliverInfo">
SELECT
d.id as deliverId,
d.`name` as deliverName,
f.id as fileId,
p.description as description,
p.time as uploadTime,
f.path as path,
p.is_history as isHistory,
p.user_id as uploaderId,
p.checker_id as checkerId,
p.check_status as checkerStatus,
p.remark as remark
FROM
t_pro_task_deliver d JOIN t_pro_task_deliver_post_log p
on p.deliver_id = d.id JOIN t_sys_commited_file f on p.file_id = f.id
WHERE
p.task_sub_time_id = #{subTimeId}
ORDER BY p.time DESC
</select>
<select id="selectDeliverByUserId" parameterType="java.util.Map" resultMap="DeliverChecklist">
SELECT
t.id as tId,
t.name as tName,
t.begin_time as tBeginTime,
t.end_time as tEndTime,
r.id as rId,
r.name as rName,
s.id as sId,
s.name as sName,
d.id as dId,
d.name as dName,
f.id as fId,
f.name as fName,
f.path as fUrl
FROM
t_pro_task_deliver d JOIN
t_pro_task_detail t on d.task_detail_id = t.id JOIN
t_pro_role r on t.executor_role = r.id JOIN
t_pro_member_role mr on mr.role_id = r.id JOIN
t_pro_member m on m.id = mr.member_id JOIN
t_sys_project s on r.project_id = s.id LEFT JOIN
t_pro_task_deliver_post_log l on d.id = l.deliver_id LEFT JOIN
t_sys_commited_file f on f.id = l.file_id
where
m.user_id = #{userId}
</select>
<select id="selectByDeliverId" parameterType="java.util.Map"
resultMap="resultMap_DeliverInfo">
select
d.id as dId,
d.name as dName,
d.is_upload as dUpload,
d.is_final as dFinals,
cf.path as cfUrl
from
t_pro_task_deliver d left join t_pro_task_deliver_post_log dp on dp.deliver_id=d.id
left join t_sys_commited_file cf on dp.file_id=cf.id
where
d.id=#{deliverId}
</select>
<select id="selectFileIdByDeliverId" parameterType="java.util.Map"
resultMap="resultMap_FilePath">
SELECT
l.id as postLogId,
f.id as fileId,
l.description as description,
f.path as url,
l.time as uploadTime,
l.is_history as history,
l.user_id as userId
FROM
`t_pro_task_deliver_post_log` l JOIN t_sys_commited_file f on l.file_id = f.id
WHERE
l.task_sub_time_id = #{subTimeId}
group by l.file_id
ORDER BY l.time DESC
</select>
<select id="selectDeliverPostLogByDeliverId" parameterType="java.util.Map"
resultType="com.ccsens.tall.bean.po.ProTaskDeliverPostLog">
SELECT
*
FROM
`t_deliver_post_log`
WHERE
deliver_id = #{deliverId}
group by checker_id
</select>
</mapper>