270 lines
18 KiB
XML
270 lines
18 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.xdadan.erp.emis.mapper.EmisTmsSiteBatchMapper">
|
|
|
|
<resultMap type="EmisTmsSiteBatch" id="EmisTmsSiteBatchResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
|
<result property="id" column="id" />
|
|
<result property="batchNo" column="batch_no" />
|
|
<result property="batchName" column="batch_name" />
|
|
<result property="batchDate" column="batch_date" />
|
|
<result property="transLineType" column="trans_line_type" />
|
|
<result property="productType" column="product_type" />
|
|
<result property="batchType" column="batch_type" />
|
|
<result property="transType" column="trans_type" />
|
|
<result property="startSiteCode" column="start_site_code" />
|
|
|
|
<result property="nextSiteCode" column="next_site_code" />
|
|
<result property="airBilllNo" column="air_billl_no" />
|
|
<result property="etd" column="etd" />
|
|
<result property="eta" column="eta" />
|
|
<result property="packNum" column="pack_num" />
|
|
<result property="carNo" column="car_no" />
|
|
<result property="shipNo" column="ship_no" />
|
|
<result property="clearanceResStatus" column="clearance_res_status" />
|
|
<result property="declareResStatus" column="declare_res_status" />
|
|
<result property="destCountry" column="dest_country" />
|
|
|
|
<result property="totalParcelQty" column="total_parcel_qty" />
|
|
<result property="totalWaybillQty" column="total_waybill_qty" />
|
|
<result property="totalVolume" column="total_volume" />
|
|
<result property="totalWeight" column="total_weight" />
|
|
<result property="opMan" column="op_man" />
|
|
|
|
<association property="productTypeName" column="product_type" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectProdNameByCode"/>
|
|
<association property="transLineTypeName" column="trans_line_type" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectLineNameByCode"/>
|
|
|
|
<!-- 个性化查询 -->
|
|
<!-- <result property="destCountryName" column="dest_country_name" />-->
|
|
<!-- <result property="sendCountry" column="send_country" />-->
|
|
|
|
<association property="sendCountryName" column="trans_line_type" select="selectFromCountryNameByLineCode"/>
|
|
<association property="destCountryName" column="dest_country" select="selectCountryNameByCode"/>
|
|
|
|
</resultMap>
|
|
|
|
<sql id="selectEmisTmsSiteBatchVo">
|
|
select id, batch_no, batch_name, batch_date, trans_line_type, product_type, batch_type, trans_type, start_site_code, send_country, next_site_code, air_billl_no, etd, eta, pack_num, car_no, ship_no, clearance_res_status, declare_res_status, dest_country, dest_country_name, total_parcel_qty, total_waybill_qty, total_volume, total_weight, op_man, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_tms_site_batch
|
|
</sql>
|
|
|
|
<select id="selectEmisTmsSiteBatchList" parameterType="EmisTmsSiteBatch" resultMap="EmisTmsSiteBatchResult">
|
|
<include refid="selectEmisTmsSiteBatchVo"/>
|
|
<where>
|
|
del_flag='0'
|
|
<if test="id != null "> and id = #{id}</if>
|
|
<if test="batchNo != null and batchNo != ''"> and batch_no like concat('%', #{batchNo}, '%')</if>
|
|
<if test="batchName != null and batchName != ''"> and batch_name like concat('%', #{batchName}, '%')</if>
|
|
<if test="batchDate != null "> and batch_date = #{batchDate}</if>
|
|
<if test="transLineType != null and transLineType != ''"> and trans_line_type like concat('%', #{transLineType}, '%')</if>
|
|
<if test="productType != null and productType != ''"> and product_type like concat('%', #{productType}, '%')</if>
|
|
<if test="batchType != null and batchType != ''"> and batch_type like concat('%', #{batchType}, '%')</if>
|
|
<if test="transType != null and transType != ''"> and trans_type like concat('%', #{transType}, '%')</if>
|
|
<if test="startSiteCode != null and startSiteCode != ''"> and start_site_code like concat('%', #{startSiteCode}, '%')</if>
|
|
<if test="sendCountry != null and sendCountry != ''"> and send_country like concat('%', #{sendCountry}, '%')</if>
|
|
<if test="nextSiteCode != null and nextSiteCode != ''"> and next_site_code like concat('%', #{nextSiteCode}, '%')</if>
|
|
<if test="airBilllNo != null and airBilllNo != ''"> and air_billl_no like concat('%', #{airBilllNo}, '%')</if>
|
|
<if test="etd != null "> and etd = #{etd}</if>
|
|
<if test="eta != null "> and eta = #{eta}</if>
|
|
<if test="packNum != null "> and pack_num = #{packNum}</if>
|
|
<if test="carNo != null and carNo != ''"> and car_no like concat('%', #{carNo}, '%')</if>
|
|
<if test="shipNo != null and shipNo != ''"> and ship_no like concat('%', #{shipNo}, '%')</if>
|
|
<if test="clearanceResStatus != null and clearanceResStatus != ''"> and clearance_res_status like concat('%', #{clearanceResStatus}, '%')</if>
|
|
<if test="declareResStatus != null and declareResStatus != ''"> and declare_res_status like concat('%', #{declareResStatus}, '%')</if>
|
|
<if test="destCountry != null and destCountry != ''"> and dest_country like concat('%', #{destCountry}, '%')</if>
|
|
<if test="destCountryName != null and destCountryName != ''"> and dest_country_name like concat('%', #{destCountryName}, '%')</if>
|
|
<if test="totalParcelQty != null "> and total_parcel_qty = #{totalParcelQty}</if>
|
|
<if test="totalWaybillQty != null "> and total_waybill_qty = #{totalWaybillQty}</if>
|
|
<if test="totalVolume != null "> and total_volume = #{totalVolume}</if>
|
|
<if test="totalWeight != null "> and total_weight = #{totalWeight}</if>
|
|
<if test="opMan != null and opMan != ''"> and op_man like concat('%', #{opMan}, '%')</if>
|
|
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
|
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
|
|
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
|
|
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
|
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
|
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
|
|
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="checkUnique" parameterType="EmisTmsSiteBatch" resultType="int">
|
|
select count(1) from emis_tms_site_batch
|
|
where del_flag='0'
|
|
and id = #{id}
|
|
and batch_no = #{batchNo}
|
|
and batch_name = #{batchName}
|
|
and batch_date = #{batchDate}
|
|
and trans_line_type = #{transLineType}
|
|
and product_type = #{productType}
|
|
and batch_type = #{batchType}
|
|
and trans_type = #{transType}
|
|
and start_site_code = #{startSiteCode}
|
|
and send_country = #{sendCountry}
|
|
and next_site_code = #{nextSiteCode}
|
|
and air_billl_no = #{airBilllNo}
|
|
and etd = #{etd}
|
|
and eta = #{eta}
|
|
and pack_num = #{packNum}
|
|
and car_no = #{carNo}
|
|
and ship_no = #{shipNo}
|
|
and clearance_res_status = #{clearanceResStatus}
|
|
and declare_res_status = #{declareResStatus}
|
|
and dest_country = #{destCountry}
|
|
and dest_country_name = #{destCountryName}
|
|
and total_parcel_qty = #{totalParcelQty}
|
|
and total_waybill_qty = #{totalWaybillQty}
|
|
and total_volume = #{totalVolume}
|
|
and total_weight = #{totalWeight}
|
|
and op_man = #{opMan}
|
|
and remark = #{remark}
|
|
and tenant_id = #{tenantId}
|
|
and del_flag = #{delFlag}
|
|
and create_by = #{createBy}
|
|
and create_time = #{createTime}
|
|
and update_by = #{updateBy}
|
|
and update_time = #{updateTime}
|
|
and create_site = #{createSite}
|
|
and update_site = #{updateSite}
|
|
limit 1
|
|
</select>
|
|
|
|
<select id="selectEmisTmsSiteBatchById" parameterType="Long" resultMap="EmisTmsSiteBatchResult">
|
|
select id, batch_no, batch_name, batch_date, trans_line_type, product_type, batch_type, trans_type, start_site_code, send_country, next_site_code, air_billl_no, etd, eta, pack_num, car_no, ship_no, clearance_res_status, declare_res_status, dest_country, dest_country_name, total_parcel_qty, total_waybill_qty, total_volume, total_weight, op_man, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
|
from emis_tms_site_batch a
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertEmisTmsSiteBatch" parameterType="EmisTmsSiteBatch" useGeneratedKeys="true" keyProperty="id">
|
|
insert into emis_tms_site_batch
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="batchNo != null and batchNo != ''">batch_no,</if>
|
|
<if test="batchName != null and batchName != ''">batch_name,</if>
|
|
<if test="batchDate != null">batch_date,</if>
|
|
<if test="transLineType != null and transLineType != ''">trans_line_type,</if>
|
|
<if test="productType != null and productType != ''">product_type,</if>
|
|
<if test="batchType != null and batchType != ''">batch_type,</if>
|
|
<if test="transType != null and transType != ''">trans_type,</if>
|
|
<if test="startSiteCode != null and startSiteCode != ''">start_site_code,</if>
|
|
<if test="sendCountry != null and sendCountry != ''">send_country,</if>
|
|
<if test="nextSiteCode != null and nextSiteCode != ''">next_site_code,</if>
|
|
<if test="airBilllNo != null and airBilllNo != ''">air_billl_no,</if>
|
|
<if test="etd != null">etd,</if>
|
|
<if test="eta != null">eta,</if>
|
|
<if test="packNum != null">pack_num,</if>
|
|
<if test="carNo != null and carNo != ''">car_no,</if>
|
|
<if test="shipNo != null and shipNo != ''">ship_no,</if>
|
|
<if test="clearanceResStatus != null and clearanceResStatus != ''">clearance_res_status,</if>
|
|
<if test="declareResStatus != null and declareResStatus != ''">declare_res_status,</if>
|
|
<if test="destCountry != null and destCountry != ''">dest_country,</if>
|
|
<if test="destCountryName != null and destCountryName != ''">dest_country_name,</if>
|
|
<if test="totalParcelQty != null">total_parcel_qty,</if>
|
|
<if test="totalWaybillQty != null">total_waybill_qty,</if>
|
|
<if test="totalVolume != null">total_volume,</if>
|
|
<if test="totalWeight != null">total_weight,</if>
|
|
<if test="opMan != null and opMan != ''">op_man,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="createSite != null and createSite != ''">create_site,</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="batchNo != null and batchNo != ''">#{batchNo},</if>
|
|
<if test="batchName != null and batchName != ''">#{batchName},</if>
|
|
<if test="batchDate != null">#{batchDate},</if>
|
|
<if test="transLineType != null and transLineType != ''">#{transLineType},</if>
|
|
<if test="productType != null and productType != ''">#{productType},</if>
|
|
<if test="batchType != null and batchType != ''">#{batchType},</if>
|
|
<if test="transType != null and transType != ''">#{transType},</if>
|
|
<if test="startSiteCode != null and startSiteCode != ''">#{startSiteCode},</if>
|
|
<if test="sendCountry != null and sendCountry != ''">#{sendCountry},</if>
|
|
<if test="nextSiteCode != null and nextSiteCode != ''">#{nextSiteCode},</if>
|
|
<if test="airBilllNo != null and airBilllNo != ''">#{airBilllNo},</if>
|
|
<if test="etd != null">#{etd},</if>
|
|
<if test="eta != null">#{eta},</if>
|
|
<if test="packNum != null">#{packNum},</if>
|
|
<if test="carNo != null and carNo != ''">#{carNo},</if>
|
|
<if test="shipNo != null and shipNo != ''">#{shipNo},</if>
|
|
<if test="clearanceResStatus != null and clearanceResStatus != ''">#{clearanceResStatus},</if>
|
|
<if test="declareResStatus != null and declareResStatus != ''">#{declareResStatus},</if>
|
|
<if test="destCountry != null and destCountry != ''">#{destCountry},</if>
|
|
<if test="destCountryName != null and destCountryName != ''">#{destCountryName},</if>
|
|
<if test="totalParcelQty != null">#{totalParcelQty},</if>
|
|
<if test="totalWaybillQty != null">#{totalWaybillQty},</if>
|
|
<if test="totalVolume != null">#{totalVolume},</if>
|
|
<if test="totalWeight != null">#{totalWeight},</if>
|
|
<if test="opMan != null and opMan != ''">#{opMan},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="createSite != null and createSite != ''">#{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEmisTmsSiteBatch" parameterType="EmisTmsSiteBatch">
|
|
update emis_tms_site_batch
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="batchNo != null and batchNo != ''">batch_no = #{batchNo},</if>
|
|
<if test="batchName != null and batchName != ''">batch_name = #{batchName},</if>
|
|
<if test="batchDate != null">batch_date = #{batchDate},</if>
|
|
<if test="transLineType != null and transLineType != ''">trans_line_type = #{transLineType},</if>
|
|
<if test="productType != null and productType != ''">product_type = #{productType},</if>
|
|
<if test="batchType != null and batchType != ''">batch_type = #{batchType},</if>
|
|
<if test="transType != null and transType != ''">trans_type = #{transType},</if>
|
|
<if test="startSiteCode != null and startSiteCode != ''">start_site_code = #{startSiteCode},</if>
|
|
<if test="sendCountry != null and sendCountry != ''">send_country = #{sendCountry},</if>
|
|
<if test="nextSiteCode != null and nextSiteCode != ''">next_site_code = #{nextSiteCode},</if>
|
|
<if test="airBilllNo != null and airBilllNo != ''">air_billl_no = #{airBilllNo},</if>
|
|
<if test="etd != null">etd = #{etd},</if>
|
|
<if test="eta != null">eta = #{eta},</if>
|
|
<if test="packNum != null">pack_num = #{packNum},</if>
|
|
<if test="carNo != null and carNo != ''">car_no = #{carNo},</if>
|
|
<if test="shipNo != null and shipNo != ''">ship_no = #{shipNo},</if>
|
|
<if test="clearanceResStatus != null and clearanceResStatus != ''">clearance_res_status = #{clearanceResStatus},</if>
|
|
<if test="declareResStatus != null and declareResStatus != ''">declare_res_status = #{declareResStatus},</if>
|
|
<if test="destCountry != null and destCountry != ''">dest_country = #{destCountry},</if>
|
|
<if test="destCountryName != null and destCountryName != ''">dest_country_name = #{destCountryName},</if>
|
|
<if test="totalParcelQty != null">total_parcel_qty = #{totalParcelQty},</if>
|
|
<if test="totalWaybillQty != null">total_waybill_qty = #{totalWaybillQty},</if>
|
|
<if test="totalVolume != null">total_volume = #{totalVolume},</if>
|
|
<if test="totalWeight != null">total_weight = #{totalWeight},</if>
|
|
<if test="opMan != null and opMan != ''">op_man = #{opMan},</if>
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteEmisTmsSiteBatchById" parameterType="Long">
|
|
delete from emis_tms_site_batch where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisTmsSiteBatchByIds" parameterType="String">
|
|
delete from emis_tms_site_batch where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |