<?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="cn.stylefeng.guns.modular.dq.materialTraceability.mapper.MaterialTraceabilityMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.dq.materialTraceability.entity.MaterialTraceability">
|
<id column="id" property="id" />
|
<result column="product_no" property="productNo" />
|
<result column="housing_bar_code" property="housingBarCode" />
|
<result column="work_order_no" property="workOrderNo" />
|
<result column="product_code" property="productCode" />
|
<result column="product_name" property="productName" />
|
<result column="line_code" property="lineCode" />
|
<result column="line_name" property="lineName" />
|
<result column="location_code" property="locationCode" />
|
<result column="location_name" property="locationName" />
|
<result column="material_code" property="materialCode" />
|
<result column="material_name" property="materialName" />
|
<result column="material_batch_no" property="materialBatchNo" />
|
<result column="material_serial_no" property="materialSerialNo" />
|
<result column="assembly_qty" property="assemblyQty" />
|
<result column="assembly_user" property="assemblyUser" />
|
<result column="assembly_time" property="assemblyTime" />
|
<result column="spare_field_1" property="spareField1" />
|
<result column="spare_field_2" property="spareField2" />
|
<result column="spare_field_3" property="spareField3" />
|
<result column="spare_field_4" property="spareField4" />
|
<result column="remarks" property="remarks" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id AS "id", product_no AS "productNo", housing_bar_code AS "housingBarCode", work_order_no AS "workOrderNo", product_code AS "productCode", product_name AS "productName", line_code AS "lineCode", line_name AS "lineName", location_code AS "locationCode", location_name AS "locationName", material_code AS "materialCode", material_name AS "materialName", material_batch_no AS "materialBatchNo", material_serial_no AS "materialSerialNo", assembly_qty AS "assemblyQty", assembly_user AS "assemblyUser", assembly_time AS "assemblyTime", spare_field_1 AS "spareField1", spare_field_2 AS "spareField2", spare_field_3 AS "spareField3", spare_field_4 AS "spareField4", remarks AS "remarks"
|
</sql>
|
|
|
<select id="customList" resultType="cn.stylefeng.guns.modular.dq.materialTraceability.model.result.MaterialTraceabilityResult" parameterType="cn.stylefeng.guns.modular.dq.materialTraceability.model.params.MaterialTraceabilityParam">
|
select
|
<include refid="Base_Column_List"/>
|
from dq_material_traceability where 1 = 1
|
<if test="paramCondition.productNo != null and paramCondition.productNo != ''">
|
and product_no like CONCAT('%',#{paramCondition.productNo},'%')
|
</if>
|
<if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">
|
and material_code like CONCAT('%',#{paramCondition.materialCode},'%')
|
</if>
|
<if test="paramCondition.workOrderNo != null and paramCondition.workOrderNo != ''">
|
and work_order_no like CONCAT('%',#{paramCondition.workOrderNo},'%')
|
</if>
|
<if test="paramCondition.materialBatchNo != null and paramCondition.materialBatchNo != ''">
|
and material_batch_no like CONCAT('%',#{paramCondition.materialBatchNo},'%')
|
</if>
|
<if test="paramCondition.materialSerialNo != null and paramCondition.materialSerialNo != ''">
|
and material_serial_no like CONCAT('%',#{paramCondition.materialSerialNo},'%')
|
</if>
|
<if test="paramCondition.startTime != null and paramCondition.startTime != ''">
|
and assembly_time >= #{paramCondition.startTime}
|
</if>
|
<if test="paramCondition.endTime != null and paramCondition.endTime != ''">
|
and assembly_time <= #{paramCondition.endTime}
|
</if>
|
</select>
|
|
<select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.dq.materialTraceability.model.params.MaterialTraceabilityParam">
|
select
|
<include refid="Base_Column_List"/>
|
from dq_material_traceability where 1 = 1
|
</select>
|
|
<select id="customPageList" resultType="cn.stylefeng.guns.modular.dq.materialTraceability.model.result.MaterialTraceabilityResult" parameterType="cn.stylefeng.guns.modular.dq.materialTraceability.model.params.MaterialTraceabilityParam">
|
select
|
<include refid="Base_Column_List"/>
|
from dq_material_traceability where 1 = 1
|
<if test="paramCondition.productNo != null and paramCondition.productNo != ''">
|
and product_no like CONCAT('%',#{paramCondition.productNo},'%')
|
</if>
|
<if test="paramCondition.workOrderNo != null and paramCondition.workOrderNo != ''">
|
and work_order_no like CONCAT('%',#{paramCondition.workOrderNo},'%')
|
</if>
|
<if test="paramCondition.materialBatchNo != null and paramCondition.materialBatchNo != ''">
|
and material_batch_no like CONCAT('%',#{paramCondition.materialBatchNo},'%')
|
</if>
|
<if test="paramCondition.materialSerialNo != null and paramCondition.materialSerialNo != ''">
|
and material_serial_no like CONCAT('%',#{paramCondition.materialSerialNo},'%')
|
</if>
|
<if test="paramCondition.startTime != null and paramCondition.startTime != ''">
|
and assembly_time >= #{paramCondition.startTime}
|
</if>
|
<if test="paramCondition.endTime != null and paramCondition.endTime != ''">
|
and assembly_time <= #{paramCondition.endTime}
|
</if>
|
</select>
|
|
<select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.dq.materialTraceability.model.params.MaterialTraceabilityParam">
|
select
|
<include refid="Base_Column_List"/>
|
from dq_material_traceability where 1 = 1
|
</select>
|
<update id="updateSFC">
|
update dq_material_traceability set product_no = #{sfcCode} where product_no = #{childSfcCode}
|
</update>
|
|
</mapper>
|