xuhy
2025-05-23 1a2e22a27627b40689257442cc5a46598c634f8e
ruoyi-system/src/main/resources/mapper/system/TExperimentSchemeMapper.xml
@@ -43,11 +43,8 @@
        left join t_experiment_dispatch ted on tes.dispatch_id = ted.id
        left join t_project_proposal tpp on ted.proposal_id = tpp.id
        <where>
            <if test="query.status != null and query.status != -1">
            <if test="query.status != null">
                and tes.status = #{query.status}
            </if>
            <if test="query.status == null">
                and tes.status != -1
            </if>
            <if test="query.projectName != null and query.projectName != ''">
                and tpp.project_name like concat('%', #{query.projectName}, '%')
@@ -57,6 +54,15 @@
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND tes.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.dispatchIds != null and query.dispatchIds.size() > 0">
                and tes.dispatch_id in
                <foreach item="item" collection="query.dispatchIds" separator="," close=")" index="index" open="(">
                    #{item}
                </foreach>
            </if>
            <if test="query.status == null">
                and tes.status != -1
            </if>
            AND tes.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
@@ -84,10 +90,29 @@
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND tes.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.dispatchIds != null and query.dispatchIds.size() > 0">
                and tes.dispatch_id in
                <foreach item="item" collection="query.dispatchIds" separator="," close=")" index="index" open="(">
                    #{item}
                </foreach>
            </if>
            AND tes.status IN (2,3,4)
            AND tes.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY tes.create_time DESC
    </select>
    <select id="getList" resultType="com.ruoyi.system.vo.TExperimentSchemeVO">
        select tes.id, tes.dispatch_id, tes.experiment_date, tes.experiment_objective, tes.experiment_param_route,
               tes.experiment_material, tes.experiment_device, tes.experiment_step_record, tes.stop_reason, tes.stop_file,tes.stop_file_name,
               tes.commit_sign, tes.status, tes.audit_person_id, tes.audit_time, tes.audit_remark, tes.create_time, tes.update_time,
               tes.create_by, tes.update_by, tes.disabled, tpp.project_name as projectName,ted.experiment_code as experimentCode,
               ted.experiment_name as experimentName
        from t_experiment_scheme tes
                 left join t_experiment_dispatch ted on tes.dispatch_id = ted.id
                 left join t_project_proposal tpp on ted.proposal_id = tpp.id
             WHERE tes.dispatch_id = #{dispatchId}
                AND tes.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
                ORDER BY tes.create_time DESC
    </select>
</mapper>