xyc
2024-07-24 413eae5cb4d5fe78fc25258bf7b5e3b53740b1f9
modules/mainPart/src/main/resources/mapper/taskReliability/TaskDao.xml
@@ -26,4 +26,58 @@
        and a.product_id=${productId}
    </select>
    <select id="getTaskModels" resultType="com.zt.life.modules.mainPart.taskReliability.model.Task">
        select
            a.*
        FROM
            task a
        where
            a.is_delete = 0
        <if test="productId!=null">
            and a.product_id=${productId}
        </if>
        <if test="taskModelId!=null">
            and a.id=${taskModelId}
        </if>
        ORDER BY a.task_sort
    </select>
    <select id="getTaskModelPhases" resultType="com.zt.life.modules.mainPart.taskReliability.model.TaskPhase">
        select
            b.*
        FROM
            task a
            inner join task_phase b on b.task_id=a.id
        where
            a.is_delete = 0
            and b.is_delete = 0
        <if test="productId!=null">
            and a.product_id=${productId}
        </if>
        <if test="taskModelId!=null">
            and a.id=${taskModelId}
        </if>
        ORDER BY a.task_sort, b.phase_sort
    </select>
    <select id="getTaskModelPhaseModels" resultType="com.zt.life.modules.mainPart.taskReliability.model.TaskPhaseModel">
        select
            c.*
        FROM
            task a
            inner join task_phase b on b.task_id=a.id
            inner join task_phase_model c on c.phase_id=b.id
            inner join operat_condit d on d.id=c.operat_condit_id
        where
            a.is_delete = 0
            and b.is_delete = 0
            and c.is_delete = 0
            and d.is_delete = 0
        <if test="productId!=null">
            and a.product_id=${productId}
            and d.product_id=${productId}
        </if>
        <if test="taskModelId!=null">
            and a.id=${taskModelId}
        </if>
        ORDER BY a.task_sort, b.phase_sort
    </select>
</mapper>