| | |
| | | <result column="promised_delivery_date" property="promisedDeliveryDate" /> |
| | | </resultMap> |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.production.bean.dto.ProductionPlanDto"> |
| | | SELECT |
| | | pp.*, |
| | | pms.material_code AS materialCode, |
| | | pms.model, |
| | | pms.product_id AS productMaterialId, |
| | | pm.product_name AS productName, |
| | | pm.unit |
| | | FROM production_plan pp |
| | | left join product_material_sku pms on pp.product_material_sku_id = pms.id |
| | | left join product_material pm on pms.product_id = pm.id |
| | | WHERE 1 = 1 |
| | | <if test="c.customerName != null and c.customerName != '' "> |
| | | AND pp.customer_name LIKE CONCAT('%',#{c.customerName},'%') |
| | | </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.status != null"> |
| | | AND pp.status =#{c.status} |
| | | </if> |
| | | <if test="c.applyNo != null and c.applyNo != '' "> |
| | | AND pp.apply_no LIKE CONCAT('%',#{c.applyNo},'%') |
| | | </if> |
| | | <if test="c.startDate != null"> |
| | | AND pp.start_date >= DATE_FORMAT(#{c.startDate},'%Y-%m-%d') |
| | | </if> |
| | | <if test="c.endDate != null"> |
| | | AND pp.end_date <= DATE_FORMAT(#{c.endDate},'%Y-%m-%d') |
| | | </if> |
| | | ORDER BY COALESCE(pp.form_modified_time, pp.id) DESC |
| | | </select> |
| | | |
| | | <select id="selectWithMaterialByIds" resultType="com.ruoyi.production.bean.dto.ProductionPlanDto"> |
| | | SELECT |
| | | pp.*, |
| | | pms.material_code AS materialCode, |
| | | pms.model, |
| | | pm.product_name AS productName, |
| | | pm.unit |
| | | FROM production_plan pp |
| | | LEFT JOIN product_material_sku pms ON pp.product_material_sku_id = pms.id |
| | | LEFT JOIN product_material pm ON pms.product_id = pm.id |
| | | WHERE pp.id IN |
| | | <foreach collection="ids" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | ORDER BY pp.id ASC |
| | | </select> |
| | | <select id="selectProductionPlanDtoById" resultType="com.ruoyi.production.bean.dto.ProductionPlanDto"> |
| | | SELECT |
| | | pp.*, |
| | | pms.material_code AS materialCode, |
| | | pms.model, |
| | | pms.product_id AS productMaterialId, |
| | | pm.product_name AS productName, |
| | | pm.unit |
| | | FROM production_plan pp |
| | | left join product_material_sku pms on pp.product_material_sku_id = pms.id |
| | | left join product_material pm on pms.product_id = pm.id |
| | | WHERE pp.id = #{productionPlanId} |
| | | </select> |
| | | </mapper> |