|
@@ -0,0 +1,194 @@
|
|
|
+<?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.tld.mapper.TraceBackMapper">
|
|
|
+ <!-- 新增销售发货单 -->
|
|
|
+ <insert id="importExcel">
|
|
|
+ insert into tld_trace_back(delivery_order,delivery_time,delivery_type,delivery_code,subsidiary_code,delivery_company,delivery_department,
|
|
|
+ customer_name,commercial_opportunity_code,commercial_opportunity_name,power_station_name,material_code,material_name,wbs,num,out_num,province,city,address)
|
|
|
+ values
|
|
|
+ <foreach collection="list" item="item" index="index" separator=",">
|
|
|
+ (#{item.deliveryOrder},#{item.deliveryTime},#{item.deliveryType},#{item.deliveryCode},#{item.subsidiaryName},#{item.deliveryCompany},#{item.deliveryDepartment},#{item.customerName},#{item.commercialOpportunityCode},#{item.commercialOpportunityName}
|
|
|
+ ,#{item.powerStationName},#{item.materialCode},#{item.materialName},#{item.wbs},#{item.num},"0",#{item.province},#{item.city},#{item.address})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+ <!-- 查询销售发货单 -->
|
|
|
+ <select id="getTraceBack" resultType="com.tld.model.TraceBack">
|
|
|
+ select
|
|
|
+ id,
|
|
|
+ delivery_order,
|
|
|
+ delivery_time,
|
|
|
+ delivery_type,
|
|
|
+ delivery_code,
|
|
|
+ subsidiary_code,
|
|
|
+ delivery_company,
|
|
|
+ delivery_department,
|
|
|
+ customer_name,
|
|
|
+ commercial_opportunity_code,
|
|
|
+ commercial_opportunity_name,
|
|
|
+ power_station_name,
|
|
|
+ material_code,
|
|
|
+ material_name,
|
|
|
+ wbs,
|
|
|
+ num,
|
|
|
+ out_num,
|
|
|
+ province,
|
|
|
+ city,
|
|
|
+ address
|
|
|
+ from tld_trace_back
|
|
|
+ <trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="deliveryOrder != null and deliveryOrder != ''">
|
|
|
+ and delivery_order like CONCAT(CONCAT('%', #{deliveryOrder}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ and delivery_time <![CDATA[>=]]> #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and delivery_time <![CDATA[<=]]> #{endTime}
|
|
|
+ </if>
|
|
|
+ <if test="deliveryType != null and deliveryType != ''">
|
|
|
+ and delivery_type like CONCAT(CONCAT('%', #{deliveryType}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="deliveryCode != null and deliveryCode != ''">
|
|
|
+ and delivery_code like CONCAT(CONCAT('%', #{deliveryCode}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="subsidiaryName != null and subsidiaryName != ''">
|
|
|
+ and subsidiary_code = #{subsidiaryName}
|
|
|
+ </if>
|
|
|
+ <if test="deliveryCompany != null and deliveryCompany != ''">
|
|
|
+ and delivery_company = #{deliveryCompany}
|
|
|
+ </if>
|
|
|
+ <if test="deliveryDepartment != null and deliveryDepartment != ''">
|
|
|
+ and delivery_department like CONCAT(CONCAT('%', #{deliveryDepartment}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="customerName != null and customerName != ''">
|
|
|
+ and customer_name like CONCAT(CONCAT('%', #{customerName}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="commercialOpportunityCode != null and commercialOpportunityCode != ''">
|
|
|
+ and commercial_opportunity_code like CONCAT(CONCAT('%', #{commercialOpportunityCode}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="commercialOpportunityName != null and commercialOpportunityName != ''">
|
|
|
+ and commercial_opportunity_name like CONCAT(CONCAT('%', #{commercialOpportunityName}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="powerStationName != null and powerStationName != ''">
|
|
|
+ and power_station_name like CONCAT(CONCAT('%', #{powerStationName}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="materialCode != null and materialCode != ''">
|
|
|
+ and material_code = #{materialCode}
|
|
|
+ </if>
|
|
|
+ <if test="materialName != null and materialName != ''">
|
|
|
+ and material_name = #{materialName}
|
|
|
+ </if>
|
|
|
+ <if test="wbs != null and wbs != ''">
|
|
|
+ and wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="province != null and province != ''">
|
|
|
+ and province like CONCAT(CONCAT('%', #{province}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="city != null and city != ''">
|
|
|
+ and city like CONCAT(CONCAT('%', #{city}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="address != null and address != ''">
|
|
|
+ and address like CONCAT(CONCAT('%', #{address}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="num != null and num != ''">
|
|
|
+ and (num + 0) <![CDATA[>]]> out_num
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+ <!-- 删除交货单 -->
|
|
|
+ <delete id="delTraceBack">
|
|
|
+ delete from tld_trace_back where id = #{id}
|
|
|
+ </delete>
|
|
|
+ <!-- 导出查询 -->
|
|
|
+ <select id="export" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ delivery_order,
|
|
|
+ delivery_time,
|
|
|
+ delivery_type,
|
|
|
+ delivery_code,
|
|
|
+ subsidiary_code,
|
|
|
+ delivery_company,
|
|
|
+ delivery_department,
|
|
|
+ customer_name,
|
|
|
+ commercial_opportunity_code,
|
|
|
+ commercial_opportunity_name,
|
|
|
+ power_station_name,
|
|
|
+ material_code,
|
|
|
+ material_name,
|
|
|
+ wbs,
|
|
|
+ num,
|
|
|
+ out_num,
|
|
|
+ province,
|
|
|
+ city,
|
|
|
+ address
|
|
|
+ from tld_trace_back
|
|
|
+ <trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="deliveryOrder != null and deliveryOrder != ''">
|
|
|
+ and delivery_order like CONCAT(CONCAT('%', #{deliveryOrder}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ and delivery_time <![CDATA[>=]]> #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and delivery_time <![CDATA[<=]]> #{endTime}
|
|
|
+ </if>
|
|
|
+ <if test="deliveryType != null and deliveryType != ''">
|
|
|
+ and delivery_type like CONCAT(CONCAT('%', #{deliveryType}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="deliveryCode != null and deliveryCode != ''">
|
|
|
+ and delivery_code like CONCAT(CONCAT('%', #{deliveryCode}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="subsidiaryName != null and subsidiaryName != ''">
|
|
|
+ and subsidiary_code = #{subsidiaryName}
|
|
|
+ </if>
|
|
|
+ <if test="deliveryCompany != null and deliveryCompany != ''">
|
|
|
+ and delivery_company = #{deliveryCompany}
|
|
|
+ </if>
|
|
|
+ <if test="deliveryDepartment != null and deliveryDepartment != ''">
|
|
|
+ and delivery_department like CONCAT(CONCAT('%', #{deliveryDepartment}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="customerName != null and customerName != ''">
|
|
|
+ and customer_name like CONCAT(CONCAT('%', #{customerName}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="commercialOpportunityCode != null and commercialOpportunityCode != ''">
|
|
|
+ and commercial_opportunity_code like CONCAT(CONCAT('%', #{commercialOpportunityCode}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="commercialOpportunityName != null and commercialOpportunityName != ''">
|
|
|
+ and commercial_opportunity_name like CONCAT(CONCAT('%', #{commercialOpportunityName}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="powerStationName != null and powerStationName != ''">
|
|
|
+ and power_station_name like CONCAT(CONCAT('%', #{powerStationName}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="materialCode != null and materialCode != ''">
|
|
|
+ and material_code = #{materialCode}
|
|
|
+ </if>
|
|
|
+ <if test="materialName != null and materialName != ''">
|
|
|
+ and material_name = #{materialName}
|
|
|
+ </if>
|
|
|
+ <if test="wbs != null and wbs != ''">
|
|
|
+ and wbs like CONCAT(CONCAT('%', #{wbs}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="province != null and province != ''">
|
|
|
+ and province like CONCAT(CONCAT('%', #{province}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="city != null and city != ''">
|
|
|
+ and city like CONCAT(CONCAT('%', #{city}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="address != null and address != ''">
|
|
|
+ and address like CONCAT(CONCAT('%', #{address}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="num != null and num != ''">
|
|
|
+ and (num + 0) <![CDATA[>]]> out_num
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+</mapper>
|