| | |
| | | <id property="id" column="id"/> |
| | | <result property="formInstanceId" column="form_instance_id"/> |
| | | <result property="serialNo" column="serial_no"/> |
| | | <result property="title" column="title"/> |
| | | <result property="originatorUserId" column="originator_user_id"/> |
| | | <result property="originatorName" column="originator_name"/> |
| | | <result property="bizCreateTime" column="biz_create_time"/> |
| | | <result property="projectName" column="project_name"/> |
| | | <result property="batchNo" column="batch_no"/> |
| | | <result property="contactPerson" column="contact_person"/> |
| | | <result property="extText1" column="ext_text1"/> |
| | | <result property="extText2" column="ext_text2"/> |
| | | <result property="materialCode" column="material_code"/> |
| | | <result property="materialCategory" column="material_category"/> |
| | | <result property="specDesc" column="spec_desc"/> |
| | | <result property="gradeType" column="grade_type"/> |
| | | <result property="applyNo" column="apply_no"/> |
| | | <result property="customerName" column="customer_name"/> |
| | | <result property="productMaterialSkuId" column="product_material_sku_id"/> |
| | | <result property="length" column="length"/> |
| | | <result property="width" column="width"/> |
| | | <result property="thickness" column="thickness"/> |
| | | <result property="height" column="height"/> |
| | | <result property="quantity" column="quantity"/> |
| | | <result property="volume" column="volume"/> |
| | | <result property="dateStart" column="date_start"/> |
| | | <result property="dateEnd" column="date_end"/> |
| | | <result property="associationReceipt" column="association_receipt"/> |
| | | <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 |
| | | production_plan.* |
| | | FROM production_plan |
| | | where 1=1 |
| | | pp.*, |
| | | pms.material_code AS materialCode, |
| | | pms.specification AS specification, |
| | | pms.material_id AS productMaterialId, |
| | | pm.material_name AS productName, |
| | | pm.base_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.material_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.material_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.specification != null and c.specification != '' "> |
| | | AND pms.specification LIKE CONCAT('%',#{c.specification},'%') |
| | | </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 |
| | | sku.material_code, |
| | | pm.material_name AS product_name, |
| | | sku.specification AS product_spec, |
| | | pp.length, |
| | | pp.width, |
| | | pp.height, |
| | | COALESCE(SUM(pp.quantity),0) AS quantity, |
| | | COALESCE(SUM(pp.volume),0) AS volume |
| | | FROM production_plan pp |
| | | LEFT JOIN product_material_sku sku |
| | | ON pp.product_material_sku_id = sku.id |
| | | LEFT JOIN product_material pm |
| | | ON sku.material_id = pm.id |
| | | <where> |
| | | <if test="materialCode != null and materialCode != ''"> |
| | | AND sku.material_code LIKE CONCAT('%', #{materialCode}, '%') |
| | | </if> |
| | | |
| | | <if test="productName != null and productName != ''"> |
| | | AND pm.material_name LIKE CONCAT('%', #{productName}, '%') |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | sku.material_code, |
| | | pm.material_name, |
| | | sku.specification, |
| | | pp.length, |
| | | pp.width, |
| | | pp.height |
| | | </select> |
| | | |
| | | <select id="selectWithMaterialByIds" resultType="com.ruoyi.productionPlan.dto.ProductionPlanDto"> |
| | | SELECT |
| | | pp.*, |
| | | pms.material_code AS materialCode, |
| | | pms.specification AS specification, |
| | | pm.material_name AS productName, |
| | | pm.base_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.material_id = pm.id |
| | | WHERE pp.id IN |
| | | <foreach collection="ids" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | ORDER BY pp.id ASC |
| | | </select> |
| | | </mapper> |