xuhy
2025-05-23 1a2e22a27627b40689257442cc5a46598c634f8e
ruoyi-system/src/main/resources/mapper/system/TResultWorkEvaluateMapper.xml
@@ -40,7 +40,7 @@
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND t1.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.status != null and query.status != -1">
            <if test="query.status != null">
                AND t1.status = #{query.status}
            </if>
            <if test="query.status == null">
@@ -56,5 +56,143 @@
        </where>
        group by t1.team_id
    </select>
    <select id="chemistEvaluateList" resultType="com.ruoyi.system.vo.TResultWorkEvaluateVO">
        select trwe.id, trwe.dispatch_id, trwe.user_id, trwe.result_report_id,trwe.evaluate_type, trwe.evaluate_one,
               trwe.evaluate_two, trwe.evaluate_three, trwe.evaluate_four, trwe.evaluate_five, trwe.evaluate_six,
               trwe.status, trwe.evaluate_person_id, trwe.evaluate_time,trwe.result_evaluate_json,trwe.team_id, trwe.create_time,
               trwe.update_time, trwe.create_by, trwe.update_by, trwe.disabled, tpp.project_name as projectName,
               ted.experiment_code as experimentCode,ted.experiment_name as experimentName
        from t_result_work_evaluate trwe
        left join t_experiment_dispatch ted on trwe.dispatch_id = ted.id
        left join t_project_proposal tpp on ted.proposal_id = tpp.id
        <where>
            <if test="query.teamName != null and query.teamName != ''">
                and tpp.team_name like concat('%',#{query.teamName},'%')
            </if>
            <if test="query.experimentCode != null and query.experimentCode != ''">
                and ted.experiment_code like concat('%',#{query.experimentCode},'%')
            </if>
            <if test="query.experimentName != null and query.experimentName != ''">
                and ted.experiment_name like concat('%',#{query.experimentName},'%')
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND trwe.evaluate_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.status != null">
                AND trwe.status = #{query.status}
            </if>
            <if test="query.teamIds != null and query.teamIds > 0">
                AND trwe.team_id in
                <foreach collection="query.teamIds" item="id" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
            AND trwe.evaluate_type = 2
            AND trwe.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY trwe.evaluate_time DESC
    </select>
    <select id="testerEvaluateList" resultType="com.ruoyi.system.vo.TResultWorkEvaluateVO">
        select trwe.id, trwe.dispatch_id, trwe.user_id, trwe.result_report_id,trwe.evaluate_type, trwe.evaluate_one,
               trwe.evaluate_two, trwe.evaluate_three, trwe.evaluate_four, trwe.evaluate_five, trwe.evaluate_six,
               trwe.status, trwe.evaluate_person_id, trwe.evaluate_time,trwe.result_evaluate_json,trwe.team_id, trwe.create_time,
               trwe.update_time, trwe.create_by, trwe.update_by, trwe.disabled, tpp.project_name as projectName,
               ted.experiment_code as experimentCode,ted.experiment_name as experimentName
        from t_result_work_evaluate trwe
        left join t_experiment_dispatch ted on trwe.dispatch_id = ted.id
        left join t_project_proposal tpp on ted.proposal_id = tpp.id
        <where>
            <if test="query.teamName != null and query.teamName != ''">
                and tpp.team_name like concat('%',#{query.teamName},'%')
            </if>
            <if test="query.experimentCode != null and query.experimentCode != ''">
                and ted.experiment_code like concat('%',#{query.experimentCode},'%')
            </if>
            <if test="query.experimentName != null and query.experimentName != ''">
                and ted.experiment_name like concat('%',#{query.experimentName},'%')
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND trwe.evaluate_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.status != null">
                AND trwe.status = #{query.status}
            </if>
            <if test="query.teamIds != null and query.teamIds > 0">
                AND trwe.team_id in
                <foreach collection="query.teamIds" item="id" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
            AND trwe.evaluate_type = 3
            AND trwe.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY trwe.evaluate_time DESC
    </select>
    <select id="getEvaluateChemistPageList" resultType="com.ruoyi.system.vo.ResultEvaluateChemistTesterVO">
        select trwe.evaluate_time,CASE WHEN trwe.id IS NOT NULL THEN 1 ELSE 0 END AS isEvaluate,trwe.id,
        tedp.id AS participantsId,tpp.project_name AS projectName,tpp.project_stage AS projectStage,
        ted.experiment_code AS experimentCode,ted.experiment_name AS experimentName,su.nick_name AS laboratoryChemistName,
        tedp.dispatch_id AS dispatchId
        from t_experiment_dispatch_participants tedp
        left join t_experiment_dispatch ted on ted.id = tedp.dispatch_id
        left join t_result_work_evaluate trwe on tedp.id = trwe.dispatch_id and trwe.evaluate_type = 2
        left join t_project_proposal tpp on ted.proposal_id = tpp.id
        left join sys_user su on tedp.user_id = su.id
        <where>
            <if test="query.experimentCode != null and query.experimentCode != ''">
                and ted.experiment_code like concat('%',#{query.experimentCode},'%')
            </if>
            <if test="query.experimentName != null and query.experimentName != ''">
                and ted.experiment_name like concat('%',#{query.experimentName},'%')
            </if>
            <if test="query.projectName != null and query.projectName != ''">
                and tpp.project_name like concat('%',#{query.projectName},'%')
            </if>
            <if test="query.userId != null">
                and tedp.user_id = #{query.userId}
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND trwe.evaluate_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.projectStage != null">
                AND tpp.project_stage = #{query.projectStage}
            </if>
            AND ted.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY trwe.evaluate_time DESC
    </select>
    <select id="getEvaluateTesterPageList" resultType="com.ruoyi.system.vo.ResultEvaluateChemistTesterVO">
        select trwe.evaluate_time,CASE WHEN trwe.id IS NOT NULL THEN 1 ELSE 0 END AS isEvaluate,trwe.id,
        tedp.id AS participantsId,tpp.project_name AS projectName,tpp.project_stage AS projectStage,
        ted.experiment_code AS experimentCode,ted.experiment_name AS experimentName,su.nick_name AS laboratoryTesterName,
        tedp.dispatch_id AS dispatchId
        from t_experiment_dispatch_participants tedp
        left join t_experiment_dispatch ted on ted.id = tedp.dispatch_id
        left join t_result_work_evaluate trwe on tedp.id = trwe.dispatch_id and trwe.evaluate_type = 3
        left join t_project_proposal tpp on ted.proposal_id = tpp.id
        left join sys_user su on tedp.user_id = su.id
        <where>
            <if test="query.experimentCode != null and query.experimentCode != ''">
                and ted.experiment_code like concat('%',#{query.experimentCode},'%')
            </if>
            <if test="query.experimentName != null and query.experimentName != ''">
                and ted.experiment_name like concat('%',#{query.experimentName},'%')
            </if>
            <if test="query.projectName != null and query.projectName != ''">
                and tpp.project_name like concat('%',#{query.projectName},'%')
            </if>
            <if test="query.userId != null">
                and tedp.user_id = #{query.userId}
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND trwe.evaluate_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.projectStage != null">
                AND tpp.project_stage = #{query.projectStage}
            </if>
            AND ted.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY trwe.evaluate_time DESC
    </select>
</mapper>