|
@@ -113,4 +113,165 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 接收kmall数据-->
|
|
|
+ <insert id="pushSalesDetaiDate" parameterType="NewSystemFormatEntiy">
|
|
|
+ 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="timeStampDetails != 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="productSpecification != 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="taxRate != null">tax_rate,</if>
|
|
|
+ <if test="taxPrice != null">tax_price,</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>
|
|
|
+
|
|
|
+ </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="timeStampDetails != null">#{timeStampDetails},</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="productSpecification != null">#{productSpecification},</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="taxRate != null">#{taxRate},</if>
|
|
|
+ <if test="taxPrice != null">#{taxPrice},</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>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 外部接口查询订单信息-->
|
|
|
+ <select id="getSalesDetaiData" parameterType="java.util.Map" resultType="com.emato.biz.domain.mall.PushSystemOdOderVo">
|
|
|
+ SELECT
|
|
|
+-- merch_sn as merchSn,
|
|
|
+ merch_sn_name as merchSnName,
|
|
|
+-- third_merch_sn as thirdMerchSn,
|
|
|
+ third_merch_sn_name as thirdMerchSnName,
|
|
|
+ receipt_no as receiptNo,
|
|
|
+ store_name as storeName,
|
|
|
+ store_name_sn as storeNameSn,
|
|
|
+ cash_register_no as cashRegisterNo,
|
|
|
+ time_stamp as timeStampDetails,
|
|
|
+ staff_id as staffID,
|
|
|
+ staff_name as staffName,
|
|
|
+ pay_flag as payFlag,
|
|
|
+ order_status as orderStatus,
|
|
|
+ order_sn_wx as orderSnWx,
|
|
|
+ order_sn_ali as orderSnAli,
|
|
|
+ hs_code as hsCode,
|
|
|
+ hs_code_name as hsCodeName,
|
|
|
+ ematou_code as ematouCode,
|
|
|
+ plu as plu,
|
|
|
+ mychem_id as mychemID,
|
|
|
+ product_name_en as productNameEN,
|
|
|
+ product_name_cn as productNameCN,
|
|
|
+ barcode as barcode,
|
|
|
+ pack_size as packSize,
|
|
|
+ product_spec as productSpecification,
|
|
|
+ brand as brand,
|
|
|
+ edlp as edlp,
|
|
|
+ current_price as currentPrice,
|
|
|
+ cost_price as costPrice,
|
|
|
+ tax_rate as taxRate,
|
|
|
+ tax_price as taxPrice,
|
|
|
+ product_category as productCategory,
|
|
|
+ supplier_name as supplierName,
|
|
|
+ transaction_type as transactionType,
|
|
|
+ sale_return_type as saleReturnType,
|
|
|
+ remark
|
|
|
+ FROM
|
|
|
+ mall_sales_detail_data
|
|
|
+<!-- WHERE-->
|
|
|
+<!-- <if test="starTime != null and starTime != ''">-->
|
|
|
+<!-- time_stamp > STR_TO_DATE(#{starTime}, '%Y-%m-%d %H:%i:%s')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="endTime != null and endTime != ''">-->
|
|
|
+<!-- AND time_stamp <= STR_TO_DATE(#{endTime}, '%Y-%m-%d %H:%i:%s')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="orderStatus !=null and orderStatus !=''">-->
|
|
|
+<!-- AND order_status = #{orderStatus}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="offset != null and limit != null">-->
|
|
|
+<!-- limit #{offset}, #{limit}-->
|
|
|
+<!-- </if>-->
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 记录外部调用接口入参-->
|
|
|
+ <insert id="pullQueryData" parameterType="java.lang.String">
|
|
|
+ insert into mall_sales_detail_log(
|
|
|
+ <if test="msg != null and msg != '' ">msg,</if>
|
|
|
+ <if test="tranDirection != null and tranDirection != '' ">tran_direction,</if>
|
|
|
+ msg_date
|
|
|
+ )values(
|
|
|
+ <if test="msg != null and msg != ''">#{msg},</if>
|
|
|
+ <if test="tranDirection != null and tranDirection != ''">#{tranDirection},</if>
|
|
|
+ sysdate()
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <select id="getPullDataTime" parameterType="java.lang.String" resultType="java.util.Date">
|
|
|
+ select msg_date from mall_sales_detail_log where tran_direction = #{tranDirection} order by msg_date desc limit 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
</mapper>
|