<?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="org.dromara.qa.md.mapper.CalibrationRecordMapper">
|
|
<resultMap type="org.dromara.qa.md.domain.CalibrationRecord" id="CalibrationRecordResult">
|
<id property="id" column="id"/>
|
<result property="targetType" column="target_type"/>
|
<result property="targetId" column="target_id"/>
|
<result property="targetCode" column="target_code"/>
|
<result property="targetName" column="target_name"/>
|
<result property="calibDate" column="calib_date"/>
|
<result property="calibCycleDays" column="calib_cycle_days"/>
|
<result property="standardWeight" column="standard_weight"/>
|
<result property="actualWeight" column="actual_weight"/>
|
<result property="deviation" column="deviation"/>
|
<result property="deviationPct" column="deviation_pct"/>
|
<result property="prevCalibDate" column="prev_calib_date"/>
|
<result property="nextCalibDate" column="next_calib_date"/>
|
<result property="batchId" column="batch_id"/>
|
<result property="note" column="note"/>
|
<result property="operator" column="operator"/>
|
<result property="createTime" column="create_time"/>
|
</resultMap>
|
|
<sql id="selectCalibrationRecordVo">
|
select id, target_type, target_id, target_code, target_name, calib_date, calib_cycle_days, standard_weight, actual_weight, deviation, deviation_pct, prev_calib_date, next_calib_date, batch_id, note, operator, create_time from qm_calibration_record
|
</sql>
|
|
<select id="selectCalibrationRecordList" parameterType="org.dromara.qa.md.domain.CalibrationRecord" resultMap="CalibrationRecordResult">
|
<include refid="selectCalibrationRecordVo"/>
|
<where>
|
<if test="targetType != null and targetType != ''">
|
and target_type = #{targetType}
|
</if>
|
<if test="targetId != null">
|
and target_id = #{targetId}
|
</if>
|
<if test="calibDate != null">
|
and calib_date = #{calibDate}
|
</if>
|
<if test="batchId != null and batchId != ''">
|
and batch_id = #{batchId}
|
</if>
|
</where>
|
order by calib_date desc
|
</select>
|
|
<select id="selectByTargetId" resultMap="CalibrationRecordResult">
|
<include refid="selectCalibrationRecordVo"/>
|
where target_type = #{targetType} and target_id = #{targetId}
|
order by calib_date desc
|
</select>
|
|
<insert id="batchInsert" parameterType="java.util.List">
|
insert into qm_calibration_record (target_type, target_id, target_code, target_name, calib_date, calib_cycle_days, standard_weight, actual_weight, deviation, deviation_pct, prev_calib_date, next_calib_date, batch_id, note, operator, create_time)
|
values
|
<foreach collection="list" item="item" separator=",">
|
(#{item.targetType}, #{item.targetId}, #{item.targetCode}, #{item.targetName}, #{item.calibDate}, #{item.calibCycleDays}, #{item.standardWeight}, #{item.actualWeight}, #{item.deviation}, #{item.deviationPct}, #{item.prevCalibDate}, #{item.nextCalibDate}, #{item.batchId}, #{item.note}, #{item.operator}, #{item.createTime})
|
</foreach>
|
</insert>
|
|
</mapper>
|