<?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.productionPlan.mapper.ProductionPlanMapper">
|
|
<resultMap id="ProductionPlanResultMap" type="com.ruoyi.productionPlan.pojo.ProductionPlan">
|
<id property="id" column="id"/>
|
<result property="formInstanceId" column="form_instance_id"/>
|
<result property="serialNo" column="serial_no"/>
|
<result property="applyNo" column="apply_no"/>
|
<result property="customerName" column="customer_name"/>
|
<result property="materialCode" column="material_code"/>
|
<result property="productName" column="product_name"/>
|
<result property="productSpec" column="product_spec"/>
|
<result property="length" column="length"/>
|
<result property="width" column="width"/>
|
<result property="height" column="height"/>
|
<result property="quantity" column="quantity"/>
|
<result property="volume" column="volume"/>
|
<result property="strength" column="strength"/>
|
<result property="startDate" column="start_date"/>
|
<result property="endDate" column="end_date"/>
|
<result property="submitter" column="submitter"/>
|
<result property="submitOrg" column="submit_org"/>
|
<result property="remarkOne" column="remark_one"/>
|
<result property="remarkTwo" column="remark_two"/>
|
<result property="creatorName" column="creator_name"/>
|
<result property="modifierName" column="modifier_name"/>
|
<result property="formCreatedTime" column="form_created_time"/>
|
<result property="formModifiedTime" column="form_modified_time"/>
|
<result property="dataSyncType" column="data_sync_type"/>
|
<result property="dataSourceType" column="data_source_type"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="totalCount" column="total_count"/>
|
</resultMap>
|
|
|
<select id="listPage" resultType="com.ruoyi.productionPlan.dto.ProductionPlanDto">
|
SELECT *
|
FROM production_plan pp
|
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 pp.product_name LIKE CONCAT('%',#{c.productName},'%')
|
</if>
|
<if test="c.productSpec != null and c.productSpec != '' ">
|
AND pp.product_spec LIKE CONCAT('%',#{c.productSpec},'%')
|
</if>
|
<if test="c.materialCode != null and c.materialCode != '' ">
|
AND pp.material_code LIKE CONCAT('%',#{c.materialCode},'%')
|
</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>
|
</select>
|
|
<select id="selectSummaryByProductType" resultType="com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto">
|
SELECT
|
material_code,
|
product_name,
|
product_spec,
|
length,
|
width,
|
height,
|
COALESCE(SUM(quantity),0) AS quantity,
|
COALESCE(SUM(volume),0) AS volume
|
FROM production_plan
|
<where>
|
<if test="materialCode != null and materialCode != ''">
|
AND material_code LIKE CONCAT('%', #{materialCode}, '%')
|
</if>
|
|
<if test="productName != null and productName != ''">
|
AND product_name LIKE CONCAT('%', #{productName}, '%')
|
</if>
|
</where>
|
GROUP BY
|
material_code,
|
product_name,
|
product_spec,
|
length,
|
width,
|
height
|
</select>
|
|
</mapper>
|