<?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.changhong.epc.parsing.mapper.tenant.BillInfoMapper">
|
|
<resultMap id="billInfoMapperResultMap" type="com.changhong.epc.bean.parsing.BillInfo">
|
<result property="orderCode" column="order_code"/>
|
<result property="formId" column="form_id"/><!-- 表单Id -->
|
<result property="formDataId" column="form_data_id"/><!-- 表单数据Id -->
|
<result property="info" column="info"/><!-- 原始数据 -->
|
<result property="infoLast" column="info_last"/><!-- 转换后数据 -->
|
<result property="verify" column="verify"/><!-- 主数据是否缺失 2:不缺失 1:缺失 -->
|
<result property="msg" column="msg"/>
|
<result property="ctId" column="ct_id"/>
|
<result property="info" column="info"/>
|
<result property="infoLast" column="info_last"/>
|
</resultMap>
|
|
<select id="selectStartZero" parameterType="int" resultMap="billInfoMapperResultMap">
|
SELECT ins_t,upd_t,ins_p,upd_p,data_start,id,order_code,info,info_last,form_id,form_data_id,if(verify = '', null, verify) verify,msg,ct_id FROM epc_bill_info_{rule}
|
WHERE data_start = #{start}
|
</select>
|
|
<update id="updateBillState">
|
UPDATE epc_bill_info_{rule}
|
set data_start =0
|
WHERE
|
order_code = #{orderCode} and data_start = 2;
|
</update>
|
|
<update id="updateBill" parameterType="com.changhong.epc.bean.parsing.BillInfo">
|
UPDATE epc_bill_info_{rule}
|
<!-- SET form_id = #{formId},
|
form_data_id = #{formDataId} -->
|
SET info = #{info},
|
data_start = #{dataStart}
|
WHERE
|
order_code = #{orderCode}
|
</update>
|
|
<insert id="addBill" parameterType="com.changhong.epc.bean.parsing.BillInfo">
|
INSERT INTO
|
epc_bill_info_{rule}
|
(
|
data_start
|
,order_code
|
,info
|
,info_last
|
)
|
VALUES (
|
#{dataStart}
|
,#{orderCode}
|
,#{info}
|
,#{infoLast}
|
)
|
</insert>
|
|
<select id="selectByOrderCode" resultType="com.changhong.epc.bean.parsing.BillInfo">
|
select form_id as formId,
|
form_data_id as formDataId,
|
info
|
from
|
epc_bill_info_{rule}
|
where
|
order_code =#{orderCode}
|
</select>
|
|
</mapper>
|