|
@@ -0,0 +1,318 @@
|
|
|
+<?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.mapper.CmRelationMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="CmRelation" >
|
|
|
+ <result column="relation_id" property="relationId" />
|
|
|
+ <result column="proc_method_id" property="procMethodId" />
|
|
|
+ <result column="customer_id" property="customerId" />
|
|
|
+ <result column="signclosed_id" property="signclosedId" />
|
|
|
+ <result column="relation_back_efast_order_id" property="relationBackEfastOrderId" />
|
|
|
+ <result column="relation_back_status" property="relationBackStatus" />
|
|
|
+ <result column="relation_back_name" property="relationBackName" />
|
|
|
+ <result column="relation_back_tel" property="relationBackTel" />
|
|
|
+ <result column="relation_back_logistics_company" property="relationBackLogisticsCompany" />
|
|
|
+ <result column="relation_back_logistics_no" property="relationBackLogisticsNo" />
|
|
|
+ <result column="relation_back_postage" property="relationBackPostage" />
|
|
|
+ <result column="relation_back_machine_no" property="relationBackMachineNo" />
|
|
|
+ <result column="relation_send_status" property="relationSendStatus" />
|
|
|
+ <result column="relation_send_name" property="relationSendName" />
|
|
|
+ <result column="relation_send_tel" property="relationSendTel" />
|
|
|
+ <result column="province_number" property="provinceNumber" />
|
|
|
+ <result column="city_number" property="cityNumber" />
|
|
|
+ <result column="area_number" property="areaNumber" />
|
|
|
+ <result column="relation_send_merge_address" property="relationSendMergeAddress" />
|
|
|
+ <result column="relation_send_address" property="relationSendAddress" />
|
|
|
+ <result column="relation_send_logistics_company" property="relationSendLogisticsCompany" />
|
|
|
+ <result column="relation_send_logistics_no" property="relationSendLogisticsNo" />
|
|
|
+ <result column="relation_desc" property="relationDesc" />
|
|
|
+ <result column="relation_state" property="relationState" />
|
|
|
+ <result column="relation_alipay" property="relationAlipay" />
|
|
|
+ <result column="relation_is_transfer" property="relationIsTransfer" />
|
|
|
+ <result column="relation_alipay_name" property="relationAlipayName" />
|
|
|
+ <result column="relation_back_receipt_date" property="relationBackReceiptDate" />
|
|
|
+ <result column="relation_factory_costs" property="relationFactoryCosts" />
|
|
|
+ <result column="relation_customer_costs" property="relationCustomerCosts" />
|
|
|
+ <result column="relation_create_time" property="relationCreateTime" />
|
|
|
+ <result column="relation_update_time" property="relationUpdateTime" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_List" >
|
|
|
+ t.relation_id,
|
|
|
+ t.proc_method_id,
|
|
|
+ t.customer_id,
|
|
|
+ t.signclosed_id,
|
|
|
+ t.relation_back_efast_order_id,
|
|
|
+ t.relation_back_status,
|
|
|
+ t.relation_back_name,
|
|
|
+ t.relation_back_tel,
|
|
|
+ t.relation_back_logistics_company,
|
|
|
+ t.relation_back_logistics_no,
|
|
|
+ t.relation_back_postage,
|
|
|
+ t.relation_back_machine_no,
|
|
|
+ t.relation_send_status,
|
|
|
+ t.relation_send_name,
|
|
|
+ t.relation_send_tel,
|
|
|
+ t.province_number,
|
|
|
+ t.city_number,
|
|
|
+ t.area_number,
|
|
|
+ t.relation_send_merge_address,
|
|
|
+ t.relation_send_address,
|
|
|
+ t.relation_send_logistics_company,
|
|
|
+ t.relation_send_logistics_no,
|
|
|
+ t.relation_desc,
|
|
|
+ t.relation_state,
|
|
|
+ t.relation_alipay,
|
|
|
+ t.relation_is_transfer,
|
|
|
+ t.relation_alipay_name,
|
|
|
+ t.relation_back_receipt_date,
|
|
|
+ t.relation_factory_costs,
|
|
|
+ t.relation_customer_costs,
|
|
|
+ t.relation_create_time,
|
|
|
+ t.relation_update_time
|
|
|
+ </sql>
|
|
|
+ <select id="getCmRelationList" resultMap="BaseResultMap" parameterType="CmRelation" >
|
|
|
+ select
|
|
|
+ <include refid="Base_List" />
|
|
|
+ from tb_rst_cm_relation t
|
|
|
+ <where>
|
|
|
+ <if test="relationId != null ">
|
|
|
+ AND t.relation_id = #{relationId}
|
|
|
+ </if >
|
|
|
+ <if test="procMethodId != null ">
|
|
|
+ AND t.proc_method_id = #{procMethodId}
|
|
|
+ </if >
|
|
|
+ <if test="customerId != null ">
|
|
|
+ AND t.customer_id = #{customerId}
|
|
|
+ </if >
|
|
|
+ <if test="signclosedId != null ">
|
|
|
+ AND t.signclosed_id = #{signclosedId}
|
|
|
+ </if >
|
|
|
+ <if test="relationBackEfastOrderId != null and relationBackEfastOrderId != ''">
|
|
|
+ AND t.relation_back_efast_order_id = #{relationBackEfastOrderId}
|
|
|
+ </if >
|
|
|
+ <if test="relationBackStatus != null ">
|
|
|
+ AND t.relation_back_status = #{relationBackStatus}
|
|
|
+ </if >
|
|
|
+ <if test="relationBackName != null and relationBackName != ''">
|
|
|
+ AND t.relation_back_name like CONCAT ('%',#{relationBackName},'%')
|
|
|
+ </if >
|
|
|
+ <if test="relationBackTel != null and relationBackTel != ''">
|
|
|
+ AND t.relation_back_tel like CONCAT ('%',#{relationBackTel},'%')
|
|
|
+ </if >
|
|
|
+ <if test="relationBackLogisticsCompany != null and relationBackLogisticsCompany != ''">
|
|
|
+ AND t.relation_back_logistics_company = #{relationBackLogisticsCompany}
|
|
|
+ </if >
|
|
|
+ <if test="relationBackLogisticsNo != null and relationBackLogisticsNo != ''">
|
|
|
+ AND t.relation_back_logistics_no like CONCAT ('%',#{relationBackLogisticsNo},'%')
|
|
|
+ </if >
|
|
|
+ <if test="relationBackMachineNo != null and relationBackMachineNo != ''">
|
|
|
+ AND t.relation_back_machine_no like CONCAT ('%',#{relationBackMachineNo},'%')
|
|
|
+ </if >
|
|
|
+ <if test="relationSendStatus != null ">
|
|
|
+ AND t.relation_send_status = #{relationSendStatus}
|
|
|
+ </if >
|
|
|
+ <if test="relationSendName != null and relationSendName != ''">
|
|
|
+ AND t.relation_send_name like CONCAT ('%',#{relationSendName},'%')
|
|
|
+ </if >
|
|
|
+ <if test="relationSendTel != null and relationSendTel != ''">
|
|
|
+ AND t.relation_send_tel like CONCAT ('%',#{relationSendTel},'%')
|
|
|
+ </if >
|
|
|
+ <if test="relationSendAddress != null and relationSendAddress != ''">
|
|
|
+ AND t.relation_send_address like CONCAT ('%',#{relationSendAddress},'%')
|
|
|
+ </if >
|
|
|
+ <if test="relationSendLogisticsCompany != null and relationSendLogisticsCompany != ''">
|
|
|
+ AND t.relation_send_logistics_company = #{relationSendLogisticsCompany}
|
|
|
+ </if >
|
|
|
+ <if test="relationSendLogisticsNo != null and relationSendLogisticsNo != ''">
|
|
|
+ AND t.relation_send_logistics_no like CONCAT ('%',#{relationSendLogisticsNo},'%')
|
|
|
+ </if >
|
|
|
+ <if test="relationState != null ">
|
|
|
+ AND t.relation_state = #{relationState}
|
|
|
+ </if >
|
|
|
+ <if test="relationIsTransfer != null ">
|
|
|
+ AND t.relation_is_transfer = #{relationIsTransfer}
|
|
|
+ </if >
|
|
|
+ <if test="relationCreateTime != null and relationCreateTime != ''">
|
|
|
+ <![CDATA[
|
|
|
+ AND t.relation_create_time >= #{beginTime}
|
|
|
+ ]]>
|
|
|
+ </if >
|
|
|
+ <if test="relationCreateTime != null and relationCreateTime != ''">
|
|
|
+ <![CDATA[
|
|
|
+ AND t.relation_create_time <= #{endTime}
|
|
|
+ ]]>
|
|
|
+ </if >
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="getCmRelationById" resultMap="BaseResultMap" parameterType="Integer" >
|
|
|
+ select
|
|
|
+ <include refid="Base_List" />
|
|
|
+ from tb_rst_cm_relation t
|
|
|
+ where t.relation_id= #{relationId}
|
|
|
+ </select>
|
|
|
+ <insert id="save" parameterType="CmRelation" >
|
|
|
+ insert into
|
|
|
+ tb_rst_cm_relation
|
|
|
+ (
|
|
|
+ proc_method_id,
|
|
|
+ customer_id,
|
|
|
+ signclosed_id,
|
|
|
+ relation_back_efast_order_id,
|
|
|
+ relation_back_status,
|
|
|
+ relation_back_name,
|
|
|
+ relation_back_tel,
|
|
|
+ relation_back_logistics_company,
|
|
|
+ relation_back_logistics_no,
|
|
|
+ relation_back_postage,
|
|
|
+ relation_back_machine_no,
|
|
|
+ relation_send_status,
|
|
|
+ relation_send_name,
|
|
|
+ relation_send_tel,
|
|
|
+ province_number,
|
|
|
+ city_number,
|
|
|
+ area_number,
|
|
|
+ relation_send_merge_address,
|
|
|
+ relation_send_address,
|
|
|
+ relation_send_logistics_company,
|
|
|
+ relation_send_logistics_no,
|
|
|
+ relation_desc,
|
|
|
+ relation_state,
|
|
|
+ relation_alipay,
|
|
|
+ relation_is_transfer,
|
|
|
+ relation_alipay_name,
|
|
|
+ relation_back_receipt_date,
|
|
|
+ relation_factory_costs,
|
|
|
+ relation_customer_costs
|
|
|
+ )
|
|
|
+ values
|
|
|
+ (
|
|
|
+ #{procMethodId},
|
|
|
+ #{customerId},
|
|
|
+ #{signclosedId},
|
|
|
+ #{relationBackEfastOrderId},
|
|
|
+ #{relationBackStatus},
|
|
|
+ #{relationBackName},
|
|
|
+ #{relationBackTel},
|
|
|
+ #{relationBackLogisticsCompany},
|
|
|
+ #{relationBackLogisticsNo},
|
|
|
+ #{relationBackPostage},
|
|
|
+ #{relationBackMachineNo},
|
|
|
+ #{relationSendStatus},
|
|
|
+ #{relationSendName},
|
|
|
+ #{relationSendTel},
|
|
|
+ #{provinceNumber},
|
|
|
+ #{cityNumber},
|
|
|
+ #{areaNumber},
|
|
|
+ #{relationSendMergeAddress},
|
|
|
+ #{relationSendAddress},
|
|
|
+ #{relationSendLogisticsCompany},
|
|
|
+ #{relationSendLogisticsNo},
|
|
|
+ #{relationDesc},
|
|
|
+ #{relationState},
|
|
|
+ #{relationAlipay},
|
|
|
+ #{relationIsTransfer},
|
|
|
+ #{relationAlipayName},
|
|
|
+ #{relationBackReceiptDate},
|
|
|
+ #{relationFactoryCosts},
|
|
|
+ #{relationCustomerCosts}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <update id="update" parameterType="CmRelation" >
|
|
|
+ update
|
|
|
+ tb_rst_cm_relation
|
|
|
+ <set >
|
|
|
+ <if test="procMethodId != null ">
|
|
|
+ proc_method_id = #{procMethodId},
|
|
|
+ </if >
|
|
|
+ <if test="customerId != null ">
|
|
|
+ customer_id = #{customerId},
|
|
|
+ </if >
|
|
|
+ <if test="signclosedId != null ">
|
|
|
+ signclosed_id = #{signclosedId},
|
|
|
+ </if >
|
|
|
+ <if test="relationBackEfastOrderId != null and relationBackEfastOrderId != ''">
|
|
|
+ relation_back_efast_order_id = #{relationBackEfastOrderId},
|
|
|
+ </if >
|
|
|
+ <if test="relationBackStatus != null ">
|
|
|
+ relation_back_status = #{relationBackStatus},
|
|
|
+ </if >
|
|
|
+ <if test="relationBackName != null and relationBackName != ''">
|
|
|
+ relation_back_name = #{relationBackName},
|
|
|
+ </if >
|
|
|
+ <if test="relationBackTel != null and relationBackTel != ''">
|
|
|
+ relation_back_tel = #{relationBackTel},
|
|
|
+ </if >
|
|
|
+ <if test="relationBackLogisticsCompany != null and relationBackLogisticsCompany != ''">
|
|
|
+ relation_back_logistics_company = #{relationBackLogisticsCompany},
|
|
|
+ </if >
|
|
|
+ <if test="relationBackLogisticsNo != null and relationBackLogisticsNo != ''">
|
|
|
+ relation_back_logistics_no = #{relationBackLogisticsNo},
|
|
|
+ </if >
|
|
|
+ <if test="relationBackPostage != null ">
|
|
|
+ relation_back_postage = #{relationBackPostage},
|
|
|
+ </if >
|
|
|
+ <if test="relationBackMachineNo != null and relationBackMachineNo != ''">
|
|
|
+ relation_back_machine_no = #{relationBackMachineNo},
|
|
|
+ </if >
|
|
|
+ <if test="relationSendStatus != null ">
|
|
|
+ relation_send_status = #{relationSendStatus},
|
|
|
+ </if >
|
|
|
+ <if test="relationSendName != null and relationSendName != ''">
|
|
|
+ relation_send_name = #{relationSendName},
|
|
|
+ </if >
|
|
|
+ <if test="relationSendTel != null and relationSendTel != ''">
|
|
|
+ relation_send_tel = #{relationSendTel},
|
|
|
+ </if >
|
|
|
+ <if test="provinceNumber != null ">
|
|
|
+ province_number = #{provinceNumber},
|
|
|
+ </if >
|
|
|
+ <if test="cityNumber != null ">
|
|
|
+ city_number = #{cityNumber},
|
|
|
+ </if >
|
|
|
+ <if test="areaNumber != null ">
|
|
|
+ area_number = #{areaNumber},
|
|
|
+ </if >
|
|
|
+ <if test="relationSendMergeAddress != null and relationSendMergeAddress != ''">
|
|
|
+ relation_send_merge_address = #{relationSendMergeAddress},
|
|
|
+ </if >
|
|
|
+ <if test="relationSendAddress != null and relationSendAddress != ''">
|
|
|
+ relation_send_address = #{relationSendAddress},
|
|
|
+ </if >
|
|
|
+ <if test="relationSendLogisticsCompany != null and relationSendLogisticsCompany != ''">
|
|
|
+ relation_send_logistics_company = #{relationSendLogisticsCompany},
|
|
|
+ </if >
|
|
|
+ <if test="relationSendLogisticsNo != null and relationSendLogisticsNo != ''">
|
|
|
+ relation_send_logistics_no = #{relationSendLogisticsNo},
|
|
|
+ </if >
|
|
|
+ <if test="relationDesc != null and relationDesc != ''">
|
|
|
+ relation_desc = #{relationDesc},
|
|
|
+ </if >
|
|
|
+ <if test="relationState != null ">
|
|
|
+ relation_state = #{relationState},
|
|
|
+ </if >
|
|
|
+ <if test="relationAlipay != null and relationAlipay != ''">
|
|
|
+ relation_alipay = #{relationAlipay},
|
|
|
+ </if >
|
|
|
+ <if test="relationIsTransfer != null ">
|
|
|
+ relation_is_transfer = #{relationIsTransfer},
|
|
|
+ </if >
|
|
|
+ <if test="relationAlipayName != null and relationAlipayName != ''">
|
|
|
+ relation_alipay_name = #{relationAlipayName},
|
|
|
+ </if >
|
|
|
+ <if test="relationBackReceiptDate != null and relationBackReceiptDate != ''">
|
|
|
+ relation_back_receipt_date = #{relationBackReceiptDate},
|
|
|
+ </if >
|
|
|
+ <if test="relationFactoryCosts != null ">
|
|
|
+ relation_factory_costs = #{relationFactoryCosts},
|
|
|
+ </if >
|
|
|
+ <if test="relationCustomerCosts != null ">
|
|
|
+ relation_customer_costs = #{relationCustomerCosts},
|
|
|
+ </if >
|
|
|
+ </set >
|
|
|
+ where relation_id= #{relationId}
|
|
|
+ </update>
|
|
|
+ <delete id="delete" parameterType="Integer" >
|
|
|
+ delete FROM
|
|
|
+ tb_rst_cm_relation
|
|
|
+ where relation_id=#{relationId}
|
|
|
+ </delete>
|
|
|
+</mapper>
|