@ -1,68 +1,105 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace= "hw.tagApi.service.mapper.HwTagRecordMapper" >
<resultMap type= "HwTagRecord" id= "HwTagRecordResult" >
<result property= "rId" column= "r_id" />
<result property= "tId" column= "t_id" />
<result property= "epc" column= "epc" />
<result property= "password" column= "password" />
<result property= "orderCode" column= "order_code" />
<result property= "batchNumber" column= "batch_number" />
<result property= "tagSequence" column= "tag_sequence" />
<result property= "totalQuantity" column= "total_quantity" />
<result property= "tagBatch" column= "tag_batch" />
<result property= "modelCode" column= "model_code" />
<result property= "processingTime" column= "processing_time" />
<result property= "operatorId" column= "operator_id" />
<result property= "delFlag" column= "del_flag" />
<result property= "fields1" column= "fields_1" />
<result property= "fields2" column= "fields_2" />
<result property= "fields3" column= "fields_3" />
<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= "remark" column= "remark" />
<result property= "rId" column= "r_id" />
<result property= "tId" column= "t_id" />
<result property= "epc" column= "epc" />
<result property= "password" column= "password" />
<result property= "orderCode" column= "order_code" />
<result property= "batchNumber" column= "batch_number" />
<result property= "tagSequence" column= "tag_sequence" />
<result property= "totalQuantity" column= "total_quantity" />
<result property= "tagBatch" column= "tag_batch" />
<result property= "modelCode" column= "model_code" />
<result property= "processingTime" column= "processing_time" />
<result property= "operatorId" column= "operator_id" />
<result property= "testResult" column= "test_result" />
<result property= "testValue" column= "test_value" />
<result property= "referenceValue" column= "reference_value" />
<result property= "testingTime" column= "testing_time" />
<result property= "fileName" column= "file_name" />
<result property= "delFlag" column= "del_flag" />
<result property= "fields1" column= "fields_1" />
<result property= "fields2" column= "fields_2" />
<result property= "fields3" column= "fields_3" />
<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= "remark" column= "remark" />
</resultMap>
<sql id= "selectHwTagRecordVo" >
select r_id, t_id, epc, password, order_code, batch_number, tag_sequence, total_quantity, tag_batch, model_code, processing_time, operator_id, del_flag, fields_1, fields_2, fields_3, create_by, create_time, update_by, update_time, remark from hw_tag_record
select r_id,
t_id,
epc,
password,
order_code,
batch_number,
tag_sequence,
total_quantity,
tag_batch,
model_code,
processing_time,
operator_id,
test_result,
test_value,
reference_value,
testing_time,
file_name,
del_flag,
fields_1,
fields_2,
fields_3,
create_by,
create_time,
update_by,
update_time,
remark
from hw_tag_record
</sql>
<select id= "selectHwTagRecordList" parameterType= "HwTagRecord" resultMap= "HwTagRecordResult" >
<include refid= "selectHwTagRecordVo" />
<where >
<if test= "tId != null and tId != ''" > and t_id = #{tId}</if>
<if test= "epc != null and epc != ''" > and epc = #{epc}</if>
<if test= "selectTID != null and selectTID != ''" > and t_id like concat('%', #{selectTID}, '%')</if>
<if test= "selectEPC != null and selectEPC != ''" > and epc like concat('%', #{selectEPC}, '%')</if>
<if test= "password != null and password != ''" > and password = #{password}</if>
<if test= "orderCode != null and orderCode != ''" > and order_code = #{orderCode}</if>
<if test= "batchNumber != null and batchNumber != ''" > and batch_number = #{batchNumber}</if>
<if test= "tagSequence != null and tagSequence != ''" > and tag_sequence = #{tagSequence}</if>
<if test= "totalQuantity != null " > and total_quantity = #{totalQuantity}</if>
<if test= "tagBatch != null and tagBatch != ''" > and tag_batch = #{tagBatch}</if>
<if test= "modelCode != null and modelCode != ''" > and model_code = #{modelCode}</if>
<if test= "params.beginProcessingTime != null and params.beginProcessingTime != '' and params.endProcessingTime != null and params.endProcessingTime != ''" > and processing_time between #{params.beginProcessingTime} and #{params.endProcessingTime}</if>
<if test= "operatorId != null and operatorId != ''" > and operator_id = #{operatorId}</if>
<if test= "fields1 != null and fields1 != ''" > and fields_1 = #{fields1}</if>
<if test= "fields2 != null and fields2 != ''" > and fields_2 = #{fields2}</if>
<if test= "fields3 != null and fields3 != ''" > and fields_3 = #{fields3}</if>
<if test= "startDate != null and startDate != ''" > and DATE_FORMAT(processing_time, '%Y/%m/%d') >= #{startDate}</if>
<if test= "endDate != null and endDate != ''" > and #{endDate} >= DATE_FORMAT(processing_time, '%Y/%m/%d')</if>
<where >
<if test= "tId != null and tId != ''" > and t_id = #{tId}</if>
<if test= "epc != null and epc != ''" > and epc = #{epc}</if>
<if test= "selectTID != null and selectTID != ''" > and t_id like concat('%', #{selectTID}, '%')</if>
<if test= "selectEPC != null and selectEPC != ''" > and epc like concat('%', #{selectEPC}, '%')</if>
<if test= "password != null and password != ''" > and password = #{password}</if>
<if test= "orderCode != null and orderCode != ''" > and order_code = #{orderCode}</if>
<if test= "batchNumber != null and batchNumber != ''" > and batch_number = #{batchNumber}</if>
<if test= "tagSequence != null and tagSequence != ''" > and tag_sequence = #{tagSequence}</if>
<if test= "totalQuantity != null " > and total_quantity = #{totalQuantity}</if>
<if test= "tagBatch != null and tagBatch != ''" > and tag_batch = #{tagBatch}</if>
<if test= "modelCode != null and modelCode != ''" > and model_code = #{modelCode}</if>
<if test= "params.beginProcessingTime != null and params.beginProcessingTime != '' and params.endProcessingTime != null and params.endProcessingTime != ''" >
and processing_time between #{params.beginProcessingTime} and #{params.endProcessingTime}
</if>
<if test= "operatorId != null and operatorId != ''" > and operator_id = #{operatorId}</if>
<if test= "fields1 != null and fields1 != ''" > and fields_1 = #{fields1}</if>
<if test= "fields2 != null and fields2 != ''" > and fields_2 = #{fields2}</if>
<if test= "fields3 != null and fields3 != ''" > and fields_3 = #{fields3}</if>
<if test= "startDate != null and startDate != ''" > and DATE_FORMAT(processing_time, '%Y/%m/%d') >=
#{startDate}
</if>
<if test= "endDate != null and endDate != ''" > and #{endDate} >= DATE_FORMAT(processing_time, '%Y/%m/%d')
</if>
</where>
</select>
<select id= "selectHwTagRecordByRId" parameterType= "Long" resultMap= "HwTagRecordResult" >
<include refid= "selectHwTagRecordVo" />
where r_id = #{rId}
</select>
<select id= "selectHwTagRecordByTxId" parameterType= "String" resultMap= "HwTagRecordResult" >
select r_id, t_id, epc from hw_tag_record
select r_id, t_id, epc
from hw_tag_record
where t_id = #{tId}
</select>
@ -81,6 +118,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "modelCode != null" > model_code,</if>
<if test= "processingTime != null" > processing_time,</if>
<if test= "operatorId != null" > operator_id,</if>
<if test= "testResult != null" > test_result,</if>
<if test= "testValue != null" > test_value,</if>
<if test= "referenceValue != null" > reference_value,</if>
<if test= "testingTime != null" > testing_time,</if>
<if test= "fileName != null" > file_name,</if>
<if test= "delFlag != null" > del_flag,</if>
<if test= "fields1 != null" > fields_1,</if>
<if test= "fields2 != null" > fields_2,</if>
@ -90,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "updateBy != null" > update_by,</if>
<if test= "updateTime != null" > update_time,</if>
<if test= "remark != null" > remark,</if>
</trim>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "rId != null" > #{rId},</if>
<if test= "tId != null and tId != ''" > #{tId},</if>
@ -104,6 +146,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "modelCode != null" > #{modelCode},</if>
<if test= "processingTime != null" > #{processingTime},</if>
<if test= "operatorId != null" > #{operatorId},</if>
<if test= "testResult != null" > #{testResult},</if>
<if test= "testValue != null" > #{testValue},</if>
<if test= "referenceValue != null" > #{referenceValue},</if>
<if test= "testingTime != null" > #{testingTime},</if>
<if test= "fileName != null" > #{fileName},</if>
<if test= "delFlag != null" > #{delFlag},</if>
<if test= "fields1 != null" > #{fields1},</if>
<if test= "fields2 != null" > #{fields2},</if>
@ -113,7 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "updateBy != null" > #{updateBy},</if>
<if test= "updateTime != null" > #{updateTime},</if>
<if test= "remark != null" > #{remark},</if>
</trim>
</trim>
</insert>
<update id= "updateHwTagRecord" parameterType= "HwTagRecord" >
@ -130,6 +177,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "modelCode != null" > model_code = #{modelCode},</if>
<if test= "processingTime != null" > processing_time = #{processingTime},</if>
<if test= "operatorId != null" > operator_id = #{operatorId},</if>
<if test= "testResult != null" > test_result = #{testResult},</if>
<if test= "testValue != null" > test_value = #{testValue},</if>
<if test= "referenceValue != null" > reference_value = #{referenceValue},</if>
<if test= "testingTime != null" > testing_time = #{testingTime},</if>
<if test= "fileName != null" > file_name = #{fileName},</if>
<if test= "delFlag != null" > del_flag = #{delFlag},</if>
<if test= "fields1 != null" > fields_1 = #{fields1},</if>
<if test= "fields2 != null" > fields_2 = #{fields2},</if>
@ -146,6 +198,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id= "updateHwTagRecordByTID" parameterType= "HwTagRecord" >
update hw_tag_record
<trim prefix= "SET" suffixOverrides= "," >
<if test= "tId != null and tId != ''" > t_id = #{tId},</if>
<if test= "epc != null and epc != ''" > epc = #{epc},</if>
<if test= "password != null" > password = #{password},</if>
<if test= "orderCode != null" > order_code = #{orderCode},</if>
@ -156,6 +209,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "modelCode != null" > model_code = #{modelCode},</if>
<if test= "processingTime != null" > processing_time = #{processingTime},</if>
<if test= "operatorId != null" > operator_id = #{operatorId},</if>
<if test= "testResult != null" > test_result = #{testResult},</if>
<if test= "testValue != null" > test_value = #{testValue},</if>
<if test= "referenceValue != null" > reference_value = #{referenceValue},</if>
<if test= "testingTime != null" > testing_time = #{testingTime},</if>
<if test= "fileName != null" > file_name = #{fileName},</if>
<if test= "delFlag != null" > del_flag = #{delFlag},</if>
<if test= "fields1 != null" > fields_1 = #{fields1},</if>
<if test= "fields2 != null" > fields_2 = #{fields2},</if>
@ -170,11 +228,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id= "deleteHwTagRecordByRId" parameterType= "Long" >
delete from hw_tag_record where r_id = #{rId}
delete
from hw_tag_record
where r_id = #{rId}
</delete>
<delete id= "deleteHwTagRecordByRIds" parameterType= "String" >
delete from hw_tag_record where r_id in
delete from hw_tag_record where r_id in
<foreach item= "rId" collection= "array" open= "(" separator= "," close= ")" >
#{rId}
</foreach>
@ -183,17 +243,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 批量新增标签记录 -->
<insert id= "batchInsertHwTagRecord" parameterType= "java.util.List" >
insert into hw_tag_record (
r_id, t_id, epc, password, order_code, batch_number,
tag_sequence, total_quantity, tag_batch, model_code,
processing_time, operator_id, fields_1, fields_2, fields_3,
create_by, create_time, update_by, update_time, remark
) values
r_id, t_id, epc, password, order_code, batch_number,
tag_sequence, total_quantity, tag_batch, model_code,
processing_time, operator_id, fields_1, fields_2, fields_3,
create_by, create_time, update_by, update_time, remark,
test_result,test_value,reference_value,testing_time,file_name
) values
<foreach collection= "list" item= "item" separator= "," >
(
#{item.rId}, #{item.tId}, #{item.epc}, #{item.password}, #{item.orderCode}, #{item.batchNumber},
#{item.tagSequence}, #{item.totalQuantity}, #{item.tagBatch}, #{item.modelCode},
#{item.processingTime}, #{item.operatorId}, #{item.fields1}, #{item.fields2}, #{item.fields3},
#{item.createBy}, sysdate(), #{item.updateBy}, sysdate(), #{item.remark}
#{item.rId}, #{item.tId}, #{item.epc}, #{item.password}, #{item.orderCode}, #{item.batchNumber},
#{item.tagSequence}, #{item.totalQuantity}, #{item.tagBatch}, #{item.modelCode},
#{item.processingTime}, #{item.operatorId}, #{item.fields1}, #{item.fields2}, #{item.fields3},
#{item.createBy}, sysdate(), #{item.updateBy}, sysdate(), #{item.remark},
#{item.testResult}, #{item.testValue},#{item.referenceValue}, #{item.testingTime},#{item.fileName}
)
</foreach>
</insert>