| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.ruoyi.quality.mapper.QualityInspectMapper"> |
| | | <select id="qualityInspectListPage" resultType="com.ruoyi.quality.pojo.QualityInspect"> |
| | | <select id="qualityInspectListPage" resultType="com.ruoyi.quality.dto.QualityInspectDto"> |
| | | SELECT |
| | | qi.*, |
| | | <choose> |
| | |
| | | pl.purchase_contract_number as purchase_contract_no |
| | | </when> |
| | | <otherwise> |
| | | pwo.work_order_no |
| | | pot.work_order_no, |
| | | po_sales.sales_contract_no |
| | | </otherwise> |
| | | </choose> |
| | | FROM |
| | |
| | | </when> |
| | | <otherwise> |
| | | LEFT JOIN production_product_main ppm ON qi.product_main_id = ppm.id |
| | | LEFT JOIN product_work_order pwo ON ppm.work_order_id = pwo.id |
| | | LEFT JOIN production_operation_task pot ON ppm.production_operation_task_id = pot.id |
| | | left join production_order po ON po.id = pot.production_order_id |
| | | left join ( |
| | | select po2.id as order_id, |
| | | group_concat(distinct sl2.sales_contract_no order by sl2.sales_contract_no separator ',') as sales_contract_no |
| | | from production_order po2 |
| | | left join production_plan pp2 |
| | | on find_in_set(pp2.id, replace(replace(replace(po2.production_plan_ids, '[', ''), ']', ''), ' ', '')) > 0 |
| | | left join sales_ledger sl2 on sl2.id = pp2.sales_ledger_id |
| | | group by po2.id |
| | | ) po_sales ON po_sales.order_id = po.id |
| | | </otherwise> |
| | | </choose> |
| | | WHERE |