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.
89 lines
3.8 KiB
89 lines
3.8 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.epmet.dao.ProjectSubProcessDao">
|
|
|
|
<resultMap type="com.epmet.entity.ProjectSubProcessEntity" id="projectSubProcessMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
<result property="projectId" column="PROJECT_ID"/>
|
|
<result property="processId" column="PROCESS_ID"/>
|
|
<result property="staffId" column="STAFF_ID"/>
|
|
<result property="platformId" column="PLATFORM_ID"/>
|
|
<result property="platformName" column="PLATFORM_NAME"/>
|
|
<result property="taskId" column="TASK_ID"/>
|
|
<result property="result" column="RESULT"/>
|
|
<result property="externalStatus" column="EXTERNAL_STATUS"/>
|
|
<result property="externalStatusDesc" column="EXTERNAL_STATUS_DESC"/>
|
|
<result property="internalStatus" column="INTERNAL_STATUS"/>
|
|
<result property="handleDate" column="HANDLE_DATE"/>
|
|
<result property="handleUserName" column="HANDLE_USER_NAME"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
</resultMap>
|
|
|
|
<!-- 查询最新记录 -->
|
|
<select id="selectSubProcess" resultType="com.epmet.dto.ProjectSubProcessDTO">
|
|
SELECT
|
|
*
|
|
FROM
|
|
project_sub_process
|
|
WHERE
|
|
DEL_FLAG = '0'
|
|
AND (
|
|
<foreach collection="projectStaffIds" item="id" separator=" or ">
|
|
PROJECT_STAFF_ID = #{id}
|
|
</foreach>
|
|
)
|
|
ORDER BY CREATED_TIME DESC
|
|
LIMIT 1
|
|
|
|
</select>
|
|
|
|
<resultMap id="subProcess" type="com.epmet.dto.result.SubProcessDTO">
|
|
<result property="platformName" column="platformName"/>
|
|
<result property="externalStatus" column="externalStatus"/>
|
|
<result property="processTime" column="processTime"/>
|
|
<result property="handleUserName" column="handleUserName"/>
|
|
<result property="result" column="result"/>
|
|
<result property="subId" column="subId"/>
|
|
<result property="processId" column="processId"/>
|
|
<collection property="subFile" column="subId" select="selectAtt" ofType="com.epmet.dto.result.PublicAndInternalFileResultDTO"/>
|
|
</resultMap>
|
|
<!-- 查询进展和附件 -->
|
|
<select id="selectSubProcessAndAttachment" resultMap="subProcess">
|
|
SELECT psp.id as subId,
|
|
psp.PLATFORM_NAME as platformName,
|
|
psp.EXTERNAL_STATUS as externalStatus,
|
|
psp.CREATED_TIME AS processTime,
|
|
psp.HANDLE_USER_NAME as handleUserName,
|
|
psp.RESULT as result,
|
|
psp.process_id as processId
|
|
FROM project_sub_process psp
|
|
WHERE psp.DEL_FLAG = 0
|
|
AND (
|
|
<foreach collection="processIds" item="processId" separator=" OR ">
|
|
psp.PROCESS_ID = #{processId}
|
|
</foreach>
|
|
)
|
|
</select>
|
|
<select id="selectAtt" resultType="com.epmet.dto.result.PublicAndInternalFileResultDTO">
|
|
SELECT
|
|
psa.ATTACHMENT_NAME AS name,
|
|
psa.ATTACHMENT_URL AS url,
|
|
psa.ATTACHMENT_TYPE AS type,
|
|
psa.ATTACHMENT_FORMAT AS format,
|
|
IFNULL(psa.ATTACHMENT_SIZE,0) AS size,
|
|
IFNULL(psa.DURATION,0) AS duration
|
|
FROM project_sub_attachment psa
|
|
WHERE psa.DEL_FLAG = '0'
|
|
AND psa.SUB_ID = #{subId}
|
|
order by psa.sort
|
|
</select>
|
|
|
|
|
|
</mapper>
|