You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
286 lines
13 KiB
XML
286 lines
13 KiB
XML
<?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.op.mes.mapper.ProEmbryoScrapMapper">
|
|
<resultMap type="com.op.mes.domain.ProOrderWorkorder" id="ProOrderWorkorderResult">
|
|
<result property="workorderId" column="workorder_id"/>
|
|
<result property="workorderCode" column="workorder_code"/>
|
|
<result property="workorderName" column="workorder_name"/>
|
|
<result property="orderId" column="order_id"/>
|
|
<result property="orderCode" column="order_code"/>
|
|
<result property="productId" column="product_id"/>
|
|
<result property="productCode" column="product_code"/>
|
|
<result property="productName" column="product_name"/>
|
|
<result property="productSpc" column="product_spc"/>
|
|
<result property="unit" column="unit"/>
|
|
<result property="quantityProduced" column="quantity_produced"/>
|
|
<result property="quantitySplit" column="quantity_split"/>
|
|
<result property="routeCode" column="route_code"/>
|
|
<result property="prodLineCode" column="prod_line_code"/>
|
|
<result property="productDate" column="product_date"/>
|
|
<result property="shiftId" column="shift_id"/>
|
|
<result property="parentOrder" column="parent_order"/>
|
|
<result property="ancestors" column="ancestors"/>
|
|
<result property="status" column="status"/>
|
|
<result property="remark" column="remark"/>
|
|
<result property="attr1" column="attr1"/>
|
|
<result property="attr2" column="attr2"/>
|
|
<result property="attr3" column="attr3"/>
|
|
<result property="attr4" column="attr4"/>
|
|
<result property="createBy" column="create_by"/>
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="updateBy" column="update_by"/>
|
|
<result property="updateTime" column="update_time"/>
|
|
<result property="prodType" column="prod_type"/>
|
|
<result property="factoryCode" column="factory_code"/>
|
|
<result property="endFlag" column="end_flag"/>
|
|
<result property="materialId" column="material_id"/>
|
|
</resultMap>
|
|
|
|
<!-- 查询工位信息的Map-->
|
|
<resultMap id="showSysPost" type="com.op.mes.domain.SysPost">
|
|
<result property="postId" column="post_id"/>
|
|
<result property="postCode" column="post_code"/>
|
|
<result property="postName" column="post_name"/>
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.op.mes.domain.ProEmbryoScrap" id="ProEmbryoScrapResult">
|
|
<result property="id" column="id"/>
|
|
<result property="scrapCode" column="scrap_code"/>
|
|
<result property="materialId" column="material__id"/>
|
|
<result property="materialCode" column="material_code"/>
|
|
<result property="materialName" column="material_name"/>
|
|
<result property="workCellId" column="work_cell_id"/>
|
|
<result property="workCellCode" column="work_cell_code"/>
|
|
<result property="workCellName" column="work_cell_name"/>
|
|
<result property="scrapQuality" column="scrap_quality"/>
|
|
<result property="unit" column="unit"/>
|
|
<result property="status" column="status"/>
|
|
<result property="remark" column="remark"/>
|
|
<result property="attr1" column="attr1"/>
|
|
<result property="attr2" column="attr2"/>
|
|
<result property="attr3" column="attr3"/>
|
|
<result property="attr4" column="attr4"/>
|
|
<result property="createBy" column="create_by"/>
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="updateBy" column="update_by"/>
|
|
<result property="updateTime" column="update_time"/>
|
|
<result property="active" column="active"/>
|
|
</resultMap>
|
|
<resultMap id="showAllProduct" type="com.op.mes.domain.Product">
|
|
<result property="productId" column="product_id"/>
|
|
<result property="productCode" column="product_code"/>
|
|
<result property="productDesc" column="product_desc_zh"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectProEmbryoScrapVo">
|
|
select id, scrap_code, material__id, material_code, material_name,
|
|
work_cell_id, work_cell_code, work_cell_name, scrap_quality,
|
|
unit, status, remark, attr1, attr2, attr3, attr4, create_by,
|
|
create_time, update_by, update_time, active from pro_embryo_scrap
|
|
</sql>
|
|
|
|
<select id="selectProEmbryoScrapList" parameterType="ProEmbryoScrap" resultMap="ProEmbryoScrapResult">
|
|
<include refid="selectProEmbryoScrapVo"/>
|
|
<where>
|
|
<if test="scrapCode != null and scrapCode != ''">and scrap_code = #{scrapCode}</if>
|
|
<if test="materialId != null and materialId != ''">and material__id = #{materialId}</if>
|
|
<if test="materialCode != null and materialCode != ''">and material_code = #{materialCode}</if>
|
|
<if test="materialName != null and materialName != ''">and material_name like concat('%', #{materialName},
|
|
'%')
|
|
</if>
|
|
<if test="workCellId != null and workCellId != ''">and work_cell_id = #{workCellId}</if>
|
|
<if test="workCellCode != null and workCellCode != ''">and work_cell_code = #{workCellCode}</if>
|
|
<if test="workCellName != null and workCellName != ''">and work_cell_name like concat('%', #{workCellName},
|
|
'%')
|
|
</if>
|
|
<if test="scrapQuality != null ">and scrap_quality = #{scrapQuality}</if>
|
|
<if test="unit != null and unit != ''">and unit = #{unit}</if>
|
|
<if test="status != null and status != ''">and status = #{status}</if>
|
|
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
|
|
<if test="attr2 != null and attr2 != ''">and attr2 = #{attr2}</if>
|
|
<if test="attr3 != null ">and attr3 = #{attr3}</if>
|
|
<if test="attr4 != null ">and attr4 = #{attr4}</if>
|
|
<if test="active != null and active != ''">and active = #{active}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectProEmbryoScrapById" parameterType="String" resultMap="ProEmbryoScrapResult">
|
|
<include refid="selectProEmbryoScrapVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
<select id="selectAllWorkorder" resultMap="ProOrderWorkorderResult">
|
|
select workorder_id, workorder_code, workorder_name, order_id, order_code,
|
|
product_id, product_code, product_name, product_spc, unit,
|
|
quantity_produced, quantity_split, route_code, prod_line_code,
|
|
product_date, shift_id, parent_order, ancestors, status, remark, attr1,
|
|
attr2, attr3, attr4, create_by, create_time, update_by, update_time,
|
|
prod_type, factory_code , eng_flag from pro_order_workorder
|
|
</select>
|
|
|
|
<!--<!– 查询所有(物料)–>-->
|
|
<!-- <select id="selectProEmbryoScrap" resultMap="ProEmbryoScrapResult">-->
|
|
<!-- select id, scrap_code, material__id, material_code, material_name,-->
|
|
<!-- work_cell_id, work_cell_code, work_cell_name, scrap_quality,-->
|
|
<!-- unit, status, remark, attr1, attr2, attr3, attr4, create_by,-->
|
|
<!-- create_time, update_by, update_time, active from pro_embryo_scrap-->
|
|
<!-- </select>-->
|
|
<select id="showAllMaterial" resultMap="showAllProduct">
|
|
select
|
|
product_id,
|
|
product_code,
|
|
product_desc_zh
|
|
from
|
|
base_product GROUP BY product_id,
|
|
product_code,
|
|
product_desc_zh
|
|
</select>
|
|
<!-- 查询所有的工位信息-->
|
|
<select id="showSysPost" resultMap="showSysPost">
|
|
SELECT
|
|
sys_post.post_id,
|
|
sys_post.post_code,
|
|
sys_post.post_name
|
|
FROM
|
|
sys_post
|
|
</select>
|
|
<select id="selectProductById" resultMap="showAllProduct">
|
|
select
|
|
product_code,
|
|
product_desc_zh
|
|
from
|
|
base_product where product_id=#{id}
|
|
</select>
|
|
|
|
<!-- 根据id查询岗位信息-->
|
|
<select id="selectPostById" resultMap="showSysPost">
|
|
SELECT
|
|
sys_post.post_code,
|
|
sys_post.post_name
|
|
FROM
|
|
sys_post where sys_post.post_id=#{id}
|
|
</select>
|
|
|
|
<!-- 根据产品的信息查工单的id-->
|
|
<select id="selectOrderWorkByProductId" resultMap="ProOrderWorkorderResult">
|
|
select workorder_id, workorder_code
|
|
from pro_order_workorder where material_id=#{id}
|
|
</select>
|
|
|
|
|
|
<!-- 根据报废单的id查询岗位和物料信息-->
|
|
<select id="selectPostAndMaterialSelectById" resultMap="ProEmbryoScrapResult">
|
|
SELECT
|
|
scrap_code,
|
|
material__id,
|
|
material_code,
|
|
material_name,
|
|
work_cell_id,work_cell_code,
|
|
work_cell_name,scrap_quality,
|
|
unit,status,remark,attr1,attr2,attr3,
|
|
attr4,create_by,create_time,update_by,update_time,
|
|
active
|
|
FROM
|
|
pro_embryo_scrap
|
|
WHERE id=#{id}
|
|
</select>
|
|
|
|
<select id="selectManyProEmbryScrap" resultMap="ProEmbryoScrapResult">
|
|
select scrap_code from pro_embryo_scrap where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</select>
|
|
|
|
|
|
<insert id="insertProEmbryoScrap" parameterType="com.op.mes.domain.ProEmbryoScrap">
|
|
insert into pro_embryo_scrap
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="scrapCode != null">scrap_code,</if>
|
|
<if test="materialId != null">material__id,</if>
|
|
<if test="materialCode != null">material_code,</if>
|
|
<if test="materialName != null">material_name,</if>
|
|
<if test="workCellId != null">work_cell_id,</if>
|
|
<if test="workCellCode != null">work_cell_code,</if>
|
|
<if test="workCellName != null">work_cell_name,</if>
|
|
<if test="scrapQuality != null">scrap_quality,</if>
|
|
<if test="unit != null">unit,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="attr1 != null">attr1,</if>
|
|
<if test="attr2 != null">attr2,</if>
|
|
<if test="attr3 != null">attr3,</if>
|
|
<if test="attr4 != null">attr4,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="active != null">active,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="scrapCode != null">#{scrapCode},</if>
|
|
<if test="materialId != null">#{materialId},</if>
|
|
<if test="materialCode != null">#{materialCode},</if>
|
|
<if test="materialName != null">#{materialName},</if>
|
|
<if test="workCellId != null">#{workCellId},</if>
|
|
<if test="workCellCode != null">#{workCellCode},</if>
|
|
<if test="workCellName != null">#{workCellName},</if>
|
|
<if test="scrapQuality != null">#{scrapQuality},</if>
|
|
<if test="unit != null">#{unit},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="attr1 != null">#{attr1},</if>
|
|
<if test="attr2 != null">#{attr2},</if>
|
|
<if test="attr3 != null">#{attr3},</if>
|
|
<if test="attr4 != null">#{attr4},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="active != null">#{active},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateProEmbryoScrap" parameterType="com.op.mes.domain.ProEmbryoScrap">
|
|
update pro_embryo_scrap
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="scrapCode != null">scrap_code = #{scrapCode},</if>
|
|
<if test="materialId != null">material__id = #{materialId},</if>
|
|
<if test="materialCode != null">material_code = #{materialCode},</if>
|
|
<if test="materialName != null">material_name = #{materialName},</if>
|
|
<if test="workCellId != null">work_cell_id = #{workCellId},</if>
|
|
<if test="workCellCode != null">work_cell_code = #{workCellCode},</if>
|
|
<if test="workCellName != null">work_cell_name = #{workCellName},</if>
|
|
<if test="scrapQuality != null">scrap_quality = #{scrapQuality},</if>
|
|
<if test="unit != null">unit = #{unit},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="attr1 != null">attr1 = #{attr1},</if>
|
|
<if test="attr2 != null">attr2 = #{attr2},</if>
|
|
<if test="attr3 != null">attr3 = #{attr3},</if>
|
|
<if test="attr4 != null">attr4 = #{attr4},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="active != null">active = #{active},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteProEmbryoScrapById" parameterType="String">
|
|
delete from pro_embryo_scrap where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteProEmbryoScrapByIds" parameterType="String">
|
|
delete from pro_embryo_scrap where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|