<?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.production.mapper.ProductionProductRouteItemMapper">
|
|
<resultMap id="BaseResultMap" type="com.ruoyi.production.pojo.ProductionProductRouteItem">
|
<id column="id" property="id"/>
|
<result column="product_main_id" property="productMainId"/>
|
<result column="post_name" property="postName"/>
|
<result column="equipment_malfunction" property="equipmentMalfunction"/>
|
<result column="equipment_disposal" property="equipmentDisposal"/>
|
<result column="process_explained" property="processExplained"/>
|
<result column="process_id" property="processId"/>
|
<result column="create_time" property="createTime"/>
|
<result column="update_time" property="updateTime"/>
|
<result column="tenant_id" property="tenantId"/>
|
</resultMap>
|
<select id="processPage" resultType="com.ruoyi.quality.dto.ProcessPageDto">
|
select ppri.id ProductionProductRouteItemId,
|
ppri.create_time,
|
ppm.product_no,
|
po.nps_no,
|
pp.name process,
|
ppri.post_name,
|
ppm.schedule,
|
pms.material_code,
|
pm.product_name,
|
pms.model,
|
po.strength,
|
ppo.quantity qualifiedQuantity,
|
ppo.scrap_qty unqualifiedQuantity,
|
ppo.quantity + ppo.scrap_qty quantity
|
from production_product_route_item ppri
|
left join production_product_main ppm on ppri.product_main_id = ppm.id
|
left join production_product_output ppo on ppo.product_main_id = ppm.id
|
left join product_order po on ppm.product_order_id = po.id
|
left join product_process pp on ppri.process_id = pp.id
|
left join product_material_sku pms on pms.id = po.product_material_sku_id
|
left join product_material pm on pm.id = pms.product_id
|
where 1=1
|
<if test="c.npsNo != null and c.npsNo != ''">
|
AND po.nps_no LIKE CONCAT('%', #{c.npsNo}, '%')
|
</if>
|
<if test="c.process != null and c.process != ''">
|
AND pp.name LIKE CONCAT('%', #{c.process}, '%')
|
</if>
|
<if test="c.productNo != null and c.productNo != ''">
|
AND ppm.product_no LIKE CONCAT('%', #{c.productNo}, '%')
|
</if>
|
<if test="c.productName != null and c.productName != ''">
|
AND pm.product_name LIKE CONCAT('%', #{c.productName}, '%')
|
</if>
|
<if test="c.materialCode != null and c.materialCode != ''">
|
AND pms.material_code LIKE CONCAT('%', #{c.materialCode}, '%')
|
</if>
|
<if test="c.model != null and c.model != ''">
|
AND pms.model LIKE CONCAT('%', #{c.model}, '%')
|
</if>
|
<if test="c.strength != null and c.strength != ''">
|
AND po.strength = #{c.strength}
|
</if>
|
<if test="c.startTime != null and c.endTime != null">
|
AND po.create_time BETWEEN #{c.startTime} AND #{c.endTime}
|
</if>
|
order by ppri.id desc
|
</select>
|
|
</mapper>
|