xyc
2024-08-02 fdb4fb8e81081534d296b738132b51bf149c2ef5
modules/mainPart/src/main/resources/mapper/taskReliability/TaskPhaseDao.xml
@@ -4,18 +4,40 @@
<mapper namespace="com.zt.life.modules.mainPart.taskReliability.dao.TaskPhaseDao">
    <select id="getList" resultType="com.zt.life.modules.mainPart.taskReliability.model.TaskPhase">
        select a.*
        from task_phase a
        <where>
            a.is_delete = 0
        SELECT
        a.*,
        b.operatConditDuration
        FROM
        task_phase a
        LEFT JOIN (select phase_id , SUM(operat_condit_duration_rate) as operatConditDuration from task_phase_model
        where is_delete =0 group by phase_id) b ON a.id = b.phase_id
            where a.is_delete = 0
            and a.task_id=${taskId}
            <if test="whereSql!=null">
                and ${whereSql}
            </if>
        </where>
        <if test="orderBySql!=null">
            ORDER BY ${orderBySql}
        </if>
            ORDER BY a.phase_sort
    </select>
    <select id="getMaxSort" resultType="java.lang.Integer">
        SELECT COUNT(*)
        FROM task_phase
        where
            is_delete = 0
            and task_id =${taskId}
    </select>
    <select id="getPhaseByTask" resultType="java.lang.Long">
        SELECT id
        FROM task_phase
        where
            is_delete = 0
          and task_id =${taskId}
        order by phase_sort
    </select>
    <select id="getListByTaskId" resultType="com.zt.life.modules.mainPart.taskReliability.model.TaskPhase">
        SELECT
            a.*
        FROM
            task_phase a
        where a.is_delete = 0
          and a.task_id=#{taskId}
        ORDER BY a.phase_sort
    </select>
</mapper>