huminmin
2026-07-10 2ee9e158e3129070f6b1fd953da1540f05d4f2b0
src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -7,6 +7,9 @@
        <id column="id" property="id" />
        <result column="product_no" property="productNo" />
        <result column="production_operation_task_id" property="productionOperationTaskId" />
        <result column="report_type" property="reportType" />
        <result column="audit_status" property="auditStatus" />
        <result column="audit_remark" property="auditRemark" />
        <result column="dept_id" property="deptId" />
        <result column="update_time" property="updateTime" />
        <result column="create_user" property="createUser" />
@@ -16,6 +19,20 @@
    <select id="listPageProductionProductMainDto" resultType="com.ruoyi.production.bean.dto.ProductionProductMainDto">
        select ppm.*,
               ppm.product_no as reportNo,
               case ppm.report_type
                   when 0 then '合格'
                   when 1 then '轻微返工'
                   when 2 then '严重返工'
                   when 3 then '报废'
                   else '未知'
                   end as reportTypeName,
               case ppm.audit_status
                   when 0 then '待审核'
                   when 1 then '审核通过'
                   when 2 then '审核不通过'
                   else '未知'
                   end as auditStatusName,
               pot.work_order_no as workOrderNo,
               case pot.status
                   when 1 then '待确认'
@@ -57,6 +74,12 @@
            <if test="c.productNo != null and c.productNo != ''">
                and ppm.product_no like concat('%', #{c.productNo}, '%')
            </if>
            <if test="c.auditStatus != null">
                and ppm.audit_status = #{c.auditStatus}
            </if>
            <if test="c.reportType != null">
                and ppm.report_type = #{c.reportType}
            </if>
            <if test="c.workOrderNo != null and c.workOrderNo != ''">
                and pot.work_order_no like concat('%', #{c.workOrderNo}, '%')
            </if>
@@ -91,6 +114,20 @@
    <select id="listProductionDetails" resultType="com.ruoyi.production.bean.dto.ProductionProductMainDto">
        select ppm.*,
               ppm.product_no as reportNo,
               case ppm.report_type
                   when 0 then '合格'
                   when 1 then '轻微返工'
                   when 2 then '严重返工'
                   when 3 then '报废'
                   else '未知'
                   end as reportTypeName,
               case ppm.audit_status
                   when 0 then '待审核'
                   when 1 then '审核通过'
                   when 2 then '审核不通过'
                   else '未知'
                   end as auditStatusName,
               pot.work_order_no as workOrderNo,
               p.product_name as productName,
               pm.model as productModelName,
@@ -125,6 +162,12 @@
                 left join production_product_output ppo on ppo.production_product_main_id = ppm.id
        <where>
            <if test="c != null">
                <if test="c.auditStatus != null">
                    and ppm.audit_status = #{c.auditStatus}
                </if>
                <if test="c.reportType != null">
                    and ppm.report_type = #{c.reportType}
                </if>
                <if test="c.productCategory != null and c.productCategory != ''">
                    and p_parent.product_name like concat('%', #{c.productCategory}, '%')
                </if>