|
|
@@ -0,0 +1,126 @@
|
|
|
+<?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.github.zuihou.business.productionReadyCenter.dao.CuttingToolApplyMapper">
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
+ <resultMap id="BaseResultMap" type="com.github.zuihou.business.productionReadyCenter.entity.CuttingToolApply">
|
|
|
+ <id column="id" jdbcType="BIGINT" property="id"/>
|
|
|
+ <result column="create_user" jdbcType="BIGINT" property="createUser"/>
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
+ <result column="update_user" jdbcType="BIGINT" property="updateUser"/>
|
|
|
+ <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
|
+ <result column="cutting_tool_name" jdbcType="VARCHAR" property="cuttingToolName"/>
|
|
|
+ <result column="resource_id" jdbcType="VARCHAR" property="resourceId"/>
|
|
|
+ <result column="plan_id" jdbcType="VARCHAR" property="planId"/>
|
|
|
+ <result column="produce_id" jdbcType="VARCHAR" property="produceId"/>
|
|
|
+ <result column="process_status" jdbcType="VARCHAR" property="processStatus"/>
|
|
|
+ <result column="resource_name" jdbcType="VARCHAR" property="resourceName"/>
|
|
|
+ <result column="cutting_tool_picture" jdbcType="VARCHAR" property="cuttingToolPicture"/>
|
|
|
+ <result column="cutting_tool_install_picture" jdbcType="VARCHAR" property="cuttingToolInstallPicture"/>
|
|
|
+ <result column="order_name" jdbcType="VARCHAR" property="orderName"/>
|
|
|
+ <result column="order_delivery_time" jdbcType="VARCHAR" property="orderDeliveryTime"/>
|
|
|
+ <result column="order_part_delivery_time" jdbcType="VARCHAR" property="orderPartDeliveryTime"/>
|
|
|
+ <result column="part_no" jdbcType="VARCHAR" property="partNo"/>
|
|
|
+ <result column="product_no" jdbcType="VARCHAR" property="productNo"/>
|
|
|
+ <result column="procedure_name" jdbcType="VARCHAR" property="procedureName"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 通用查询结果列 -->
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id,create_user,create_time,update_user,update_time,cutting_tool_name, resource_id, plan_id, produce_id, process_status, resourceName, cuttingToolPicture, cuttingToolInstallPicture,
|
|
|
+ orderName, orderDeliveryTime, orderPartDeliveryTime, partNo, productNo, partName, procedureNo, procedureName
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="findPage" resultType="com.github.zuihou.business.productionReadyCenter.entity.CuttingToolApply">
|
|
|
+ SELECT
|
|
|
+ tmp.*
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ icta.id,
|
|
|
+ icta.cutting_tool_name AS cuttingToolName,
|
|
|
+ icta.process_status AS processStatus,
|
|
|
+ (case icta.process_status when '0' then '未处理' when '1' then '缺料' when '2' then '已处理' end) AS processStatusName,
|
|
|
+ (SELECT
|
|
|
+ itp.name
|
|
|
+ FROM imcs_tenant_productionresource itp
|
|
|
+ WHERE icta.resource_id = itp.id) AS resourceName,
|
|
|
+ (SELECT
|
|
|
+ ict.cutting_tool_picture
|
|
|
+ FROM imcs_cutting_tool ict
|
|
|
+ WHERE ict.cutting_tool_name = icta.cutting_tool_name) AS cuttingToolPicture,
|
|
|
+ (SELECT
|
|
|
+ ict.cutting_tool_install_picture
|
|
|
+ FROM imcs_cutting_tool ict
|
|
|
+ WHERE ict.cutting_tool_name = icta.cutting_tool_name) AS cuttingToolInstallPicture,
|
|
|
+ ioo.order_name AS orderName,
|
|
|
+ ioo.delivery_time AS orderDeliveryTime,
|
|
|
+ ioop.delivery_time AS orderPartDeliveryTime,
|
|
|
+ ibb.no AS partNo,
|
|
|
+ ibb.product_no AS productNo,
|
|
|
+ ibb.name AS partName,
|
|
|
+ ibbp.no AS procedureNo,
|
|
|
+ ibbp.name AS procedureName
|
|
|
+ FROM imcs_cutting_tool_apply icta,
|
|
|
+ imcs_p_plan_product ippp,
|
|
|
+ imcs_o_order_product ioop,
|
|
|
+ imcs_o_order ioo,
|
|
|
+ imcs_b_bom ibb,
|
|
|
+ imcs_b_bom_procedure ibbp
|
|
|
+ WHERE icta.plan_id = ippp.plan_id
|
|
|
+ AND ippp.bom_id = ibb.id
|
|
|
+ AND ippp.bom_id = ioop.bom_id
|
|
|
+ AND ippp.order_id = ioop.order_id
|
|
|
+ AND ioop.order_id = ioo.id
|
|
|
+ AND icta.produce_id = ibbp.id
|
|
|
+ ) tmp ${ew.customSqlSegment}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findPageByQueryWrapper" resultType="com.github.zuihou.business.productionReadyCenter.entity.CuttingToolApply">
|
|
|
+ SELECT
|
|
|
+ tmp.*
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ icta.id,
|
|
|
+ icta.cutting_tool_name AS cuttingToolName,
|
|
|
+ icta.process_status AS processStatus,
|
|
|
+ (case icta.process_status when '0' then '未处理' when '1' then '缺料' when '2' then '已处理' end) AS processStatusName,
|
|
|
+ (SELECT
|
|
|
+ itp.name
|
|
|
+ FROM imcs_tenant_productionresource itp
|
|
|
+ WHERE icta.resource_id = itp.id) AS resourceName,
|
|
|
+ (SELECT
|
|
|
+ ict.cutting_tool_picture
|
|
|
+ FROM imcs_cutting_tool ict
|
|
|
+ WHERE ict.cutting_tool_name = icta.cutting_tool_name) AS cuttingToolPicture,
|
|
|
+ (SELECT
|
|
|
+ ict.cutting_tool_install_picture
|
|
|
+ FROM imcs_cutting_tool ict
|
|
|
+ WHERE ict.cutting_tool_name = icta.cutting_tool_name) AS cuttingToolInstallPicture,
|
|
|
+ ioo.order_name AS orderName,
|
|
|
+ ioo.delivery_time AS orderDeliveryTime,
|
|
|
+ ioop.delivery_time AS orderPartDeliveryTime,
|
|
|
+ ibb.no AS partNo,
|
|
|
+ ibb.product_no AS productNo,
|
|
|
+ ibb.name AS partName,
|
|
|
+ ibbp.no AS procedureNo,
|
|
|
+ ibbp.name AS procedureName
|
|
|
+ FROM imcs_cutting_tool_apply icta,
|
|
|
+ imcs_p_plan_product ippp,
|
|
|
+ imcs_o_order_product ioop,
|
|
|
+ imcs_o_order ioo,
|
|
|
+ imcs_b_bom ibb,
|
|
|
+ imcs_b_bom_procedure ibbp
|
|
|
+ WHERE icta.plan_id = ippp.plan_id
|
|
|
+ AND ippp.bom_id = ibb.id
|
|
|
+ AND ippp.bom_id = ioop.bom_id
|
|
|
+ AND ippp.order_id = ioop.order_id
|
|
|
+ AND ioop.order_id = ioo.id
|
|
|
+ AND icta.produce_id = ibbp.id
|
|
|
+ ) tmp ${ew.customSqlSegment}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="markProcessStatus" parameterType="com.github.zuihou.business.productionReadyCenter.entity.CuttingToolApply">
|
|
|
+ UPDATE imcs_cutting_tool_apply icta set icta.process_status = #{processStatus} where id = #{id}
|
|
|
+ </update>
|
|
|
+</mapper>
|