xuhy
2025-09-02 5d2d6fdff67f8f9a7e65abdbb4b87dba07dcb32b
ruoyi-system/src/main/resources/mapper/system/TQaProduceReportMapper.xml
@@ -47,17 +47,20 @@
            <if test="query.teamName != null and query.teamName != ''">
                and tpt.team_name like concat('%', #{query.teamName}, '%')
            </if>
            <if test="query.status != null and query.status != -1">
                and tqpr.status = #{query.status}
            <if test="query.reportType != null">
                and tqpr.report_type = #{query.reportType}
            </if>
            <if test="query.status == null">
                and tqpr.status != -1
            <if test="query.status != null">
                and tqpr.status = #{query.status}
            </if>
            <if test="query.teamIds != null and query.teamIds.size() > 0">
                and tqpr.team_id in
                <foreach collection="query.teamIds" item="teamId" open="(" separator="," close=")">
                    #{teamId}
                </foreach>
            </if>
            <if test="query.status == null">
                and tqpr.status != -1
            </if>
            AND tqpr.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
@@ -80,6 +83,9 @@
            <if test="query.teamName != null and query.teamName != ''">
                and tpt.team_name like concat('%', #{query.teamName}, '%')
            </if>
            <if test="query.reportType != null">
                and tqpr.report_type = #{query.reportType}
            </if>
            <if test="query.status != null">
                and tqpr.status = #{query.status}
            </if>
@@ -94,5 +100,37 @@
        </where>
        ORDER BY tqpr.create_time DESC
    </select>
    <select id="evaluateCount" resultType="java.util.Map">
        select
        COUNT(tqpr.id) as totalCount,
        SUM(CASE WHEN tqpr.status = 2 THEN 1 ELSE 0 END) AS toEvaluatedCount,
        SUM(CASE WHEN tqpr.status = 3 THEN 1 ELSE 0 END) AS evaluatedCount
        from t_qa_produce_report tqpr
        left join t_project_team tpt on tpt.id = tqpr.team_id
        <where>
            <if test="query.reportTitle != null and query.reportTitle != ''">
                and tqpr.report_title like concat('%', #{query.reportTitle}, '%')
            </if>
            <if test="query.reportCode != null and query.reportCode != ''">
                and tqpr.report_code like concat('%', #{query.reportCode}, '%')
            </if>
            <if test="query.teamName != null and query.teamName != ''">
                and tpt.team_name like concat('%', #{query.teamName}, '%')
            </if>
            <if test="query.reportType != null">
                and tqpr.report_type = #{query.reportType}
            </if>
            <if test="query.status != null">
                and tqpr.status = #{query.status}
            </if>
            <if test="query.teamIds != null and query.teamIds.size() > 0">
                and tqpr.team_id in
                <foreach collection="query.teamIds" item="teamId" open="(" separator="," close=")">
                    #{teamId}
                </foreach>
            </if>
            AND tqpr.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
    </select>
</mapper>