|
|
@@ -0,0 +1,226 @@
|
|
|
+<?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.fs.his.mapper.OrderDetailSummaryMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.fs.his.domain.OrderDetailSummary" id="OrderDetailSummaryResult">
|
|
|
+ <result property="externalOrderNo" column="external_order_no"/>
|
|
|
+ <result property="orderNo" column="order_no"/>
|
|
|
+ <result property="customerNo" column="customer_no"/>
|
|
|
+ <result property="agentNo" column="agent_no"/>
|
|
|
+ <result property="agentName" column="agent_name"/>
|
|
|
+ <result property="agentGroup" column="agent_group"/>
|
|
|
+ <result property="deptInfo" column="dept_info"/>
|
|
|
+ <result property="servicePerson" column="service_person"/>
|
|
|
+ <result property="orderDate" column="order_date"/>
|
|
|
+ <result property="customerName" column="customer_name"/>
|
|
|
+ <result property="customerMobile" column="customer_mobile"/>
|
|
|
+ <result property="customerPhone1" column="customer_phone1"/>
|
|
|
+ <result property="orderStatus" column="order_status"/>
|
|
|
+ <result property="signStatus" column="sign_status"/>
|
|
|
+ <result property="address" column="address"/>
|
|
|
+ <result property="productOrdered" column="product_ordered"/>
|
|
|
+ <result property="deposit" column="deposit"/>
|
|
|
+ <result property="amount" column="amount"/>
|
|
|
+ <result property="collectionAmount" column="collection_amount"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ <result property="trackingNo" column="tracking_no"/>
|
|
|
+ <result property="shipDate" column="ship_date"/>
|
|
|
+ <result property="courierCompany" column="courier_company"/>
|
|
|
+ <result property="refundAmount" column="refund_amount"/>
|
|
|
+ <result property="refundDate" column="refund_date"/>
|
|
|
+ <result property="orderType" column="order_type"/>
|
|
|
+ <result property="auditor" column="auditor"/>
|
|
|
+ <result property="auditTime" column="audit_time"/>
|
|
|
+ <result property="memberLevel" column="member_level"/>
|
|
|
+ <result property="memberAge" column="member_age"/>
|
|
|
+ <result property="gender" column="gender"/>
|
|
|
+ <result property="diseaseName" column="disease_name"/>
|
|
|
+ <result property="province" column="province"/>
|
|
|
+ <result property="city" column="city"/>
|
|
|
+ <result property="district" column="district"/>
|
|
|
+ <result property="town" column="town"/>
|
|
|
+ <result property="customerPhone2" column="customer_phone2"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectOrderDetailSummaryVo">
|
|
|
+ select external_order_no, order_no, customer_no, agent_no, agent_name, agent_group, dept_info, service_person, order_date, customer_name, customer_mobile, customer_phone1, order_status, sign_status, address, product_ordered, deposit, amount, collection_amount, remark, tracking_no, ship_date, courier_company, refund_amount, refund_date, order_type, auditor, audit_time, member_level, member_age, gender, disease_name, province, city, district, town, customer_phone2 from order_detail_summary
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectOrderDetailSummaryList" parameterType="com.fs.his.domain.OrderDetailSummary" resultMap="OrderDetailSummaryResult">
|
|
|
+ <include refid="selectOrderDetailSummaryVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="externalOrderNo != null and externalOrderNo != ''">and external_order_no = #{externalOrderNo}</if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">and order_no = #{orderNo}</if>
|
|
|
+ <if test="customerNo != null and customerNo != ''">and customer_no = #{customerNo}</if>
|
|
|
+ <if test="agentNo != null and agentNo != ''">and agent_no = #{agentNo}</if>
|
|
|
+ <if test="agentName != null and agentName != ''">and agent_name like concat('%', #{agentName}, '%')</if>
|
|
|
+ <if test="agentGroup != null and agentGroup != ''">and agent_group = #{agentGroup}</if>
|
|
|
+ <if test="deptInfo != null and deptInfo != ''">and dept_info like concat('%', #{deptInfo}, '%')</if>
|
|
|
+ <if test="servicePerson != null and servicePerson != ''">and service_person like concat('%', #{servicePerson}, '%')</if>
|
|
|
+ <if test="orderDateStart != null and orderDateStart != '' and orderDateEnd != null and orderDateEnd != ''">
|
|
|
+ and order_date between #{orderDateStart} and #{orderDateEnd}
|
|
|
+ </if>
|
|
|
+ <if test="customerName != null and customerName != ''">and customer_name like concat('%', #{customerName}, '%')</if>
|
|
|
+ <if test="customerMobile != null and customerMobile != ''">and customer_mobile = #{customerMobile}</if>
|
|
|
+ <if test="orderStatus != null and orderStatus != ''">and order_status = #{orderStatus}</if>
|
|
|
+ <if test="signStatus != null and signStatus != ''">and sign_status = #{signStatus}</if>
|
|
|
+ <if test="orderType != null and orderType != ''">and order_type = #{orderType}</if>
|
|
|
+ <if test="province != null and province != ''">and province = #{province}</if>
|
|
|
+ <if test="city != null and city != ''">and city = #{city}</if>
|
|
|
+ <if test="district != null and district != ''">and district = #{district}</if>
|
|
|
+ </where>
|
|
|
+ order by order_date desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectOrderDetailSummaryByExternalOrderNo" parameterType="String" resultMap="OrderDetailSummaryResult">
|
|
|
+ <include refid="selectOrderDetailSummaryVo"/>
|
|
|
+ where external_order_no = #{externalOrderNo}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertOrderDetailSummary" parameterType="com.fs.his.domain.OrderDetailSummary">
|
|
|
+ insert into order_detail_summary
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="externalOrderNo != null and externalOrderNo != ''">external_order_no,</if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">order_no,</if>
|
|
|
+ <if test="customerNo != null and customerNo != ''">customer_no,</if>
|
|
|
+ <if test="agentNo != null and agentNo != ''">agent_no,</if>
|
|
|
+ <if test="agentName != null and agentName != ''">agent_name,</if>
|
|
|
+ <if test="agentGroup != null and agentGroup != ''">agent_group,</if>
|
|
|
+ <if test="deptInfo != null and deptInfo != ''">dept_info,</if>
|
|
|
+ <if test="servicePerson != null and servicePerson != ''">service_person,</if>
|
|
|
+ <if test="orderDate != null">order_date,</if>
|
|
|
+ <if test="customerName != null and customerName != ''">customer_name,</if>
|
|
|
+ <if test="customerMobile != null and customerMobile != ''">customer_mobile,</if>
|
|
|
+ <if test="customerPhone1 != null and customerPhone1 != ''">customer_phone1,</if>
|
|
|
+ <if test="orderStatus != null and orderStatus != ''">order_status,</if>
|
|
|
+ <if test="signStatus != null and signStatus != ''">sign_status,</if>
|
|
|
+ <if test="address != null and address != ''">address,</if>
|
|
|
+ <if test="productOrdered != null and productOrdered != ''">product_ordered,</if>
|
|
|
+ <if test="deposit != null">deposit,</if>
|
|
|
+ <if test="amount != null">amount,</if>
|
|
|
+ <if test="collectionAmount != null">collection_amount,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="trackingNo != null and trackingNo != ''">tracking_no,</if>
|
|
|
+ <if test="shipDate != null">ship_date,</if>
|
|
|
+ <if test="courierCompany != null and courierCompany != ''">courier_company,</if>
|
|
|
+ <if test="refundAmount != null">refund_amount,</if>
|
|
|
+ <if test="refundDate != null">refund_date,</if>
|
|
|
+ <if test="orderType != null and orderType != ''">order_type,</if>
|
|
|
+ <if test="auditor != null and auditor != ''">auditor,</if>
|
|
|
+ <if test="auditTime != null">audit_time,</if>
|
|
|
+ <if test="memberLevel != null and memberLevel != ''">member_level,</if>
|
|
|
+ <if test="memberAge != null">member_age,</if>
|
|
|
+ <if test="gender != null and gender != ''">gender,</if>
|
|
|
+ <if test="diseaseName != null and diseaseName != ''">disease_name,</if>
|
|
|
+ <if test="province != null and province != ''">province,</if>
|
|
|
+ <if test="city != null and city != ''">city,</if>
|
|
|
+ <if test="district != null and district != ''">district,</if>
|
|
|
+ <if test="town != null and town != ''">town,</if>
|
|
|
+ <if test="customerPhone2 != null and customerPhone2 != ''">customer_phone2,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="externalOrderNo != null and externalOrderNo != ''">#{externalOrderNo},</if>
|
|
|
+ <if test="orderNo != null and orderNo != ''">#{orderNo},</if>
|
|
|
+ <if test="customerNo != null and customerNo != ''">#{customerNo},</if>
|
|
|
+ <if test="agentNo != null and agentNo != ''">#{agentNo},</if>
|
|
|
+ <if test="agentName != null and agentName != ''">#{agentName},</if>
|
|
|
+ <if test="agentGroup != null and agentGroup != ''">#{agentGroup},</if>
|
|
|
+ <if test="deptInfo != null and deptInfo != ''">#{deptInfo},</if>
|
|
|
+ <if test="servicePerson != null and servicePerson != ''">#{servicePerson},</if>
|
|
|
+ <if test="orderDate != null">#{orderDate},</if>
|
|
|
+ <if test="customerName != null and customerName != ''">#{customerName},</if>
|
|
|
+ <if test="customerMobile != null and customerMobile != ''">#{customerMobile},</if>
|
|
|
+ <if test="customerPhone1 != null and customerPhone1 != ''">#{customerPhone1},</if>
|
|
|
+ <if test="orderStatus != null and orderStatus != ''">#{orderStatus},</if>
|
|
|
+ <if test="signStatus != null and signStatus != ''">#{signStatus},</if>
|
|
|
+ <if test="address != null and address != ''">#{address},</if>
|
|
|
+ <if test="productOrdered != null and productOrdered != ''">#{productOrdered},</if>
|
|
|
+ <if test="deposit != null">#{deposit},</if>
|
|
|
+ <if test="amount != null">#{amount},</if>
|
|
|
+ <if test="collectionAmount != null">#{collectionAmount},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="trackingNo != null and trackingNo != ''">#{trackingNo},</if>
|
|
|
+ <if test="shipDate != null">#{shipDate},</if>
|
|
|
+ <if test="courierCompany != null and courierCompany != ''">#{courierCompany},</if>
|
|
|
+ <if test="refundAmount != null">#{refundAmount},</if>
|
|
|
+ <if test="refundDate != null">#{refundDate},</if>
|
|
|
+ <if test="orderType != null and orderType != ''">#{orderType},</if>
|
|
|
+ <if test="auditor != null and auditor != ''">#{auditor},</if>
|
|
|
+ <if test="auditTime != null">#{auditTime},</if>
|
|
|
+ <if test="memberLevel != null and memberLevel != ''">#{memberLevel},</if>
|
|
|
+ <if test="memberAge != null">#{memberAge},</if>
|
|
|
+ <if test="gender != null and gender != ''">#{gender},</if>
|
|
|
+ <if test="diseaseName != null and diseaseName != ''">#{diseaseName},</if>
|
|
|
+ <if test="province != null and province != ''">#{province},</if>
|
|
|
+ <if test="city != null and city != ''">#{city},</if>
|
|
|
+ <if test="district != null and district != ''">#{district},</if>
|
|
|
+ <if test="town != null and town != ''">#{town},</if>
|
|
|
+ <if test="customerPhone2 != null and customerPhone2 != ''">#{customerPhone2},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrderDetailSummaryBatch" parameterType="java.util.List">
|
|
|
+ insert into order_detail_summary(external_order_no, order_no, customer_no, agent_no, agent_name, agent_group, dept_info, service_person, order_date, customer_name, customer_mobile, customer_phone1, order_status, sign_status, address, product_ordered, deposit, amount, collection_amount, remark, tracking_no, ship_date, courier_company, refund_amount, refund_date, order_type, auditor, audit_time, member_level, member_age, gender, disease_name, province, city, district, town, customer_phone2)
|
|
|
+ values
|
|
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
+ (#{item.externalOrderNo}, #{item.orderNo}, #{item.customerNo}, #{item.agentNo}, #{item.agentName}, #{item.agentGroup}, #{item.deptInfo}, #{item.servicePerson}, #{item.orderDate}, #{item.customerName}, #{item.customerMobile}, #{item.customerPhone1}, #{item.orderStatus}, #{item.signStatus}, #{item.address}, #{item.productOrdered}, #{item.deposit}, #{item.amount}, #{item.collectionAmount}, #{item.remark}, #{item.trackingNo}, #{item.shipDate}, #{item.courierCompany}, #{item.refundAmount}, #{item.refundDate}, #{item.orderType}, #{item.auditor}, #{item.auditTime}, #{item.memberLevel}, #{item.memberAge}, #{item.gender}, #{item.diseaseName}, #{item.province}, #{item.city}, #{item.district}, #{item.town}, #{item.customerPhone2})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateOrderDetailSummary" parameterType="com.fs.his.domain.OrderDetailSummary">
|
|
|
+ update order_detail_summary
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="orderNo != null and orderNo != ''">order_no = #{orderNo},</if>
|
|
|
+ <if test="customerNo != null and customerNo != ''">customer_no = #{customerNo},</if>
|
|
|
+ <if test="agentNo != null and agentNo != ''">agent_no = #{agentNo},</if>
|
|
|
+ <if test="agentName != null and agentName != ''">agent_name = #{agentName},</if>
|
|
|
+ <if test="agentGroup != null and agentGroup != ''">agent_group = #{agentGroup},</if>
|
|
|
+ <if test="deptInfo != null and deptInfo != ''">dept_info = #{deptInfo},</if>
|
|
|
+ <if test="servicePerson != null and servicePerson != ''">service_person = #{servicePerson},</if>
|
|
|
+ <if test="orderDate != null">order_date = #{orderDate},</if>
|
|
|
+ <if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
|
|
|
+ <if test="customerMobile != null and customerMobile != ''">customer_mobile = #{customerMobile},</if>
|
|
|
+ <if test="customerPhone1 != null and customerPhone1 != ''">customer_phone1 = #{customerPhone1},</if>
|
|
|
+ <if test="orderStatus != null and orderStatus != ''">order_status = #{orderStatus},</if>
|
|
|
+ <if test="signStatus != null and signStatus != ''">sign_status = #{signStatus},</if>
|
|
|
+ <if test="address != null and address != ''">address = #{address},</if>
|
|
|
+ <if test="productOrdered != null and productOrdered != ''">product_ordered = #{productOrdered},</if>
|
|
|
+ <if test="deposit != null">deposit = #{deposit},</if>
|
|
|
+ <if test="amount != null">amount = #{amount},</if>
|
|
|
+ <if test="collectionAmount != null">collection_amount = #{collectionAmount},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="trackingNo != null and trackingNo != ''">tracking_no = #{trackingNo},</if>
|
|
|
+ <if test="shipDate != null">ship_date = #{shipDate},</if>
|
|
|
+ <if test="courierCompany != null and courierCompany != ''">courier_company = #{courierCompany},</if>
|
|
|
+ <if test="refundAmount != null">refund_amount = #{refundAmount},</if>
|
|
|
+ <if test="refundDate != null">refund_date = #{refundDate},</if>
|
|
|
+ <if test="orderType != null and orderType != ''">order_type = #{orderType},</if>
|
|
|
+ <if test="auditor != null and auditor != ''">auditor = #{auditor},</if>
|
|
|
+ <if test="auditTime != null">audit_time = #{auditTime},</if>
|
|
|
+ <if test="memberLevel != null and memberLevel != ''">member_level = #{memberLevel},</if>
|
|
|
+ <if test="memberAge != null">member_age = #{memberAge},</if>
|
|
|
+ <if test="gender != null and gender != ''">gender = #{gender},</if>
|
|
|
+ <if test="diseaseName != null and diseaseName != ''">disease_name = #{diseaseName},</if>
|
|
|
+ <if test="province != null and province != ''">province = #{province},</if>
|
|
|
+ <if test="city != null and city != ''">city = #{city},</if>
|
|
|
+ <if test="district != null and district != ''">district = #{district},</if>
|
|
|
+ <if test="town != null and town != ''">town = #{town},</if>
|
|
|
+ <if test="customerPhone2 != null and customerPhone2 != ''">customer_phone2 = #{customerPhone2},</if>
|
|
|
+ </trim>
|
|
|
+ where external_order_no = #{externalOrderNo}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteOrderDetailSummaryByExternalOrderNo" parameterType="String">
|
|
|
+ delete from order_detail_summary where external_order_no = #{externalOrderNo}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteOrderDetailSummaryBatch" parameterType="String">
|
|
|
+ delete from order_detail_summary where external_order_no in
|
|
|
+ <foreach item="externalOrderNo" collection="externalOrderNos" open="(" separator="," close=")">
|
|
|
+ #{externalOrderNo}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|