|
@@ -0,0 +1,219 @@
|
|
|
|
+<?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.emato.biz.mapper.mall.MallSalesDetailDataMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="com.emato.biz.domain.mall.MallSalesDetailData" id="MallSalesDetailDataResult">
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
+ <result property="merchSn" column="merch_sn" />
|
|
|
|
+ <result property="merchSnName" column="merch_sn_name" />
|
|
|
|
+ <result property="thirdMerchSn" column="third_merch_sn" />
|
|
|
|
+ <result property="thirdMerchSnName" column="third_merch_sn_name" />
|
|
|
|
+ <result property="receiptNo" column="receipt_no" />
|
|
|
|
+ <result property="storeName" column="store_name" />
|
|
|
|
+ <result property="storeNameSn" column="store_name_sn" />
|
|
|
|
+ <result property="cashRegisterNo" column="cash_register_no" />
|
|
|
|
+ <result property="timeStamp" column="time_stamp" />
|
|
|
|
+ <result property="staffId" column="staff_id" />
|
|
|
|
+ <result property="staffName" column="staff_name" />
|
|
|
|
+ <result property="payFlag" column="pay_flag" />
|
|
|
|
+ <result property="orderStatus" column="order_status" />
|
|
|
|
+ <result property="orderSnWx" column="order_sn_wx" />
|
|
|
|
+ <result property="orderSnAli" column="order_sn_ali" />
|
|
|
|
+ <result property="hsCode" column="hs_code" />
|
|
|
|
+ <result property="hsCodeName" column="hs_code_name" />
|
|
|
|
+ <result property="ematouCode" column="ematou_code" />
|
|
|
|
+ <result property="plu" column="plu" />
|
|
|
|
+ <result property="mychemId" column="mychem_id" />
|
|
|
|
+ <result property="productNameEn" column="product_name_en" />
|
|
|
|
+ <result property="productNameCn" column="product_name_cn" />
|
|
|
|
+ <result property="barcode" column="barcode" />
|
|
|
|
+ <result property="packSize" column="pack_size" />
|
|
|
|
+ <result property="productSpec" column="product_spec" />
|
|
|
|
+ <result property="brand" column="brand" />
|
|
|
|
+ <result property="edlp" column="edlp" />
|
|
|
|
+ <result property="currentPrice" column="current_price" />
|
|
|
|
+ <result property="costPrice" column="cost_price" />
|
|
|
|
+ <result property="taxPrice" column="tax_price" />
|
|
|
|
+ <result property="taxRate" column="tax_rate" />
|
|
|
|
+ <result property="productCategory" column="product_category" />
|
|
|
|
+ <result property="supplierName" column="supplier_name" />
|
|
|
|
+ <result property="transactionType" column="transaction_type" />
|
|
|
|
+ <result property="saleReturnType" column="sale_return_type" />
|
|
|
|
+ <result property="remark" column="remark" />
|
|
|
|
+ <result property="createrSn" column="creater_sn" />
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
+ <result property="moderSn" column="moder_sn" />
|
|
|
|
+ <result property="modTime" column="mod_time" />
|
|
|
|
+ <result property="tstm" column="tstm" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectMallSalesDetailDataVo">
|
|
|
|
+ select id, merch_sn, merch_sn_name, third_merch_sn, third_merch_sn_name, receipt_no, store_name, store_name_sn, cash_register_no, time_stamp, staff_id, staff_name, pay_flag, order_status, order_sn_wx, order_sn_ali, hs_code, hs_code_name, ematou_code, plu, mychem_id, product_name_en, product_name_cn, barcode, pack_size, product_spec, brand, edlp, current_price, cost_price, tax_price, tax_rate, product_category, supplier_name, transaction_type, sale_return_type, remark, creater_sn, create_time, moder_sn, mod_time, tstm from mall_sales_detail_data
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectMallSalesDetailDataList" parameterType="com.emato.biz.domain.mall.MallSalesDetailData" resultMap="MallSalesDetailDataResult">
|
|
|
|
+ <include refid="selectMallSalesDetailDataVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="receiptNo != null and receiptNo != ''"> and receipt_no like concat('%', #{receiptNo}, '%')</if>
|
|
|
|
+ <if test="ematouCode != null and ematouCode != ''"> and ematou_code like concat('%', #{ematouCode}, '%')</if>
|
|
|
|
+ <if test="barcode != null and barcode != ''"> and barcode like concat('%', #{barcode}, '%')</if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectMallSalesDetailDataById" parameterType="Integer" resultMap="MallSalesDetailDataResult">
|
|
|
|
+ <include refid="selectMallSalesDetailDataVo"/>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertMallSalesDetailData" parameterType="com.emato.biz.domain.mall.MallSalesDetailData" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
+ insert into mall_sales_detail_data
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="merchSn != null">merch_sn,</if>
|
|
|
|
+ <if test="merchSnName != null">merch_sn_name,</if>
|
|
|
|
+ <if test="thirdMerchSn != null">third_merch_sn,</if>
|
|
|
|
+ <if test="thirdMerchSnName != null">third_merch_sn_name,</if>
|
|
|
|
+ <if test="receiptNo != null">receipt_no,</if>
|
|
|
|
+ <if test="storeName != null">store_name,</if>
|
|
|
|
+ <if test="storeNameSn != null">store_name_sn,</if>
|
|
|
|
+ <if test="cashRegisterNo != null">cash_register_no,</if>
|
|
|
|
+ <if test="timeStamp != null">time_stamp,</if>
|
|
|
|
+ <if test="staffId != null">staff_id,</if>
|
|
|
|
+ <if test="staffName != null">staff_name,</if>
|
|
|
|
+ <if test="payFlag != null">pay_flag,</if>
|
|
|
|
+ <if test="orderStatus != null">order_status,</if>
|
|
|
|
+ <if test="orderSnWx != null">order_sn_wx,</if>
|
|
|
|
+ <if test="orderSnAli != null">order_sn_ali,</if>
|
|
|
|
+ <if test="hsCode != null">hs_code,</if>
|
|
|
|
+ <if test="hsCodeName != null">hs_code_name,</if>
|
|
|
|
+ <if test="ematouCode != null">ematou_code,</if>
|
|
|
|
+ <if test="plu != null">plu,</if>
|
|
|
|
+ <if test="mychemId != null">mychem_id,</if>
|
|
|
|
+ <if test="productNameEn != null">product_name_en,</if>
|
|
|
|
+ <if test="productNameCn != null">product_name_cn,</if>
|
|
|
|
+ <if test="barcode != null">barcode,</if>
|
|
|
|
+ <if test="packSize != null">pack_size,</if>
|
|
|
|
+ <if test="productSpec != null">product_spec,</if>
|
|
|
|
+ <if test="brand != null">brand,</if>
|
|
|
|
+ <if test="edlp != null">edlp,</if>
|
|
|
|
+ <if test="currentPrice != null">current_price,</if>
|
|
|
|
+ <if test="costPrice != null">cost_price,</if>
|
|
|
|
+ <if test="taxPrice != null">tax_price,</if>
|
|
|
|
+ <if test="taxRate != null">tax_rate,</if>
|
|
|
|
+ <if test="productCategory != null">product_category,</if>
|
|
|
|
+ <if test="supplierName != null">supplier_name,</if>
|
|
|
|
+ <if test="transactionType != null">transaction_type,</if>
|
|
|
|
+ <if test="saleReturnType != null">sale_return_type,</if>
|
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
|
+ <if test="createrSn != null">creater_sn,</if>
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
+ <if test="moderSn != null">moder_sn,</if>
|
|
|
|
+ <if test="modTime != null">mod_time,</if>
|
|
|
|
+ <if test="tstm != null">tstm,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="merchSn != null">#{merchSn},</if>
|
|
|
|
+ <if test="merchSnName != null">#{merchSnName},</if>
|
|
|
|
+ <if test="thirdMerchSn != null">#{thirdMerchSn},</if>
|
|
|
|
+ <if test="thirdMerchSnName != null">#{thirdMerchSnName},</if>
|
|
|
|
+ <if test="receiptNo != null">#{receiptNo},</if>
|
|
|
|
+ <if test="storeName != null">#{storeName},</if>
|
|
|
|
+ <if test="storeNameSn != null">#{storeNameSn},</if>
|
|
|
|
+ <if test="cashRegisterNo != null">#{cashRegisterNo},</if>
|
|
|
|
+ <if test="timeStamp != null">#{timeStamp},</if>
|
|
|
|
+ <if test="staffId != null">#{staffId},</if>
|
|
|
|
+ <if test="staffName != null">#{staffName},</if>
|
|
|
|
+ <if test="payFlag != null">#{payFlag},</if>
|
|
|
|
+ <if test="orderStatus != null">#{orderStatus},</if>
|
|
|
|
+ <if test="orderSnWx != null">#{orderSnWx},</if>
|
|
|
|
+ <if test="orderSnAli != null">#{orderSnAli},</if>
|
|
|
|
+ <if test="hsCode != null">#{hsCode},</if>
|
|
|
|
+ <if test="hsCodeName != null">#{hsCodeName},</if>
|
|
|
|
+ <if test="ematouCode != null">#{ematouCode},</if>
|
|
|
|
+ <if test="plu != null">#{plu},</if>
|
|
|
|
+ <if test="mychemId != null">#{mychemId},</if>
|
|
|
|
+ <if test="productNameEn != null">#{productNameEn},</if>
|
|
|
|
+ <if test="productNameCn != null">#{productNameCn},</if>
|
|
|
|
+ <if test="barcode != null">#{barcode},</if>
|
|
|
|
+ <if test="packSize != null">#{packSize},</if>
|
|
|
|
+ <if test="productSpec != null">#{productSpec},</if>
|
|
|
|
+ <if test="brand != null">#{brand},</if>
|
|
|
|
+ <if test="edlp != null">#{edlp},</if>
|
|
|
|
+ <if test="currentPrice != null">#{currentPrice},</if>
|
|
|
|
+ <if test="costPrice != null">#{costPrice},</if>
|
|
|
|
+ <if test="taxPrice != null">#{taxPrice},</if>
|
|
|
|
+ <if test="taxRate != null">#{taxRate},</if>
|
|
|
|
+ <if test="productCategory != null">#{productCategory},</if>
|
|
|
|
+ <if test="supplierName != null">#{supplierName},</if>
|
|
|
|
+ <if test="transactionType != null">#{transactionType},</if>
|
|
|
|
+ <if test="saleReturnType != null">#{saleReturnType},</if>
|
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
|
+ <if test="createrSn != null">#{createrSn},</if>
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
+ <if test="moderSn != null">#{moderSn},</if>
|
|
|
|
+ <if test="modTime != null">#{modTime},</if>
|
|
|
|
+ <if test="tstm != null">#{tstm},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateMallSalesDetailData" parameterType="com.emato.biz.domain.mall.MallSalesDetailData">
|
|
|
|
+ update mall_sales_detail_data
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="merchSn != null">merch_sn = #{merchSn},</if>
|
|
|
|
+ <if test="merchSnName != null">merch_sn_name = #{merchSnName},</if>
|
|
|
|
+ <if test="thirdMerchSn != null">third_merch_sn = #{thirdMerchSn},</if>
|
|
|
|
+ <if test="thirdMerchSnName != null">third_merch_sn_name = #{thirdMerchSnName},</if>
|
|
|
|
+ <if test="receiptNo != null">receipt_no = #{receiptNo},</if>
|
|
|
|
+ <if test="storeName != null">store_name = #{storeName},</if>
|
|
|
|
+ <if test="storeNameSn != null">store_name_sn = #{storeNameSn},</if>
|
|
|
|
+ <if test="cashRegisterNo != null">cash_register_no = #{cashRegisterNo},</if>
|
|
|
|
+ <if test="timeStamp != null">time_stamp = #{timeStamp},</if>
|
|
|
|
+ <if test="staffId != null">staff_id = #{staffId},</if>
|
|
|
|
+ <if test="staffName != null">staff_name = #{staffName},</if>
|
|
|
|
+ <if test="payFlag != null">pay_flag = #{payFlag},</if>
|
|
|
|
+ <if test="orderStatus != null">order_status = #{orderStatus},</if>
|
|
|
|
+ <if test="orderSnWx != null">order_sn_wx = #{orderSnWx},</if>
|
|
|
|
+ <if test="orderSnAli != null">order_sn_ali = #{orderSnAli},</if>
|
|
|
|
+ <if test="hsCode != null">hs_code = #{hsCode},</if>
|
|
|
|
+ <if test="hsCodeName != null">hs_code_name = #{hsCodeName},</if>
|
|
|
|
+ <if test="ematouCode != null">ematou_code = #{ematouCode},</if>
|
|
|
|
+ <if test="plu != null">plu = #{plu},</if>
|
|
|
|
+ <if test="mychemId != null">mychem_id = #{mychemId},</if>
|
|
|
|
+ <if test="productNameEn != null">product_name_en = #{productNameEn},</if>
|
|
|
|
+ <if test="productNameCn != null">product_name_cn = #{productNameCn},</if>
|
|
|
|
+ <if test="barcode != null">barcode = #{barcode},</if>
|
|
|
|
+ <if test="packSize != null">pack_size = #{packSize},</if>
|
|
|
|
+ <if test="productSpec != null">product_spec = #{productSpec},</if>
|
|
|
|
+ <if test="brand != null">brand = #{brand},</if>
|
|
|
|
+ <if test="edlp != null">edlp = #{edlp},</if>
|
|
|
|
+ <if test="currentPrice != null">current_price = #{currentPrice},</if>
|
|
|
|
+ <if test="costPrice != null">cost_price = #{costPrice},</if>
|
|
|
|
+ <if test="taxPrice != null">tax_price = #{taxPrice},</if>
|
|
|
|
+ <if test="taxRate != null">tax_rate = #{taxRate},</if>
|
|
|
|
+ <if test="productCategory != null">product_category = #{productCategory},</if>
|
|
|
|
+ <if test="supplierName != null">supplier_name = #{supplierName},</if>
|
|
|
|
+ <if test="transactionType != null">transaction_type = #{transactionType},</if>
|
|
|
|
+ <if test="saleReturnType != null">sale_return_type = #{saleReturnType},</if>
|
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
|
+ <if test="createrSn != null">creater_sn = #{createrSn},</if>
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
+ <if test="moderSn != null">moder_sn = #{moderSn},</if>
|
|
|
|
+ <if test="modTime != null">mod_time = #{modTime},</if>
|
|
|
|
+ <if test="tstm != null">tstm = #{tstm},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteMallSalesDetailDataById" parameterType="Integer">
|
|
|
|
+ delete from mall_sales_detail_data where id = #{id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteMallSalesDetailDataByIds" parameterType="String">
|
|
|
|
+ delete from mall_sales_detail_data where id in
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+</mapper>
|