从erp中同步采购/销售订单数据
parent
7ac2b4256e
commit
550fb33713
@ -0,0 +1,66 @@
|
||||
package com.hw.jindie.mapper;
|
||||
|
||||
import com.hw.jindie.domain.MesPurchaseOrder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 采购订单信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-02-19
|
||||
*/
|
||||
public interface MesPurchaseOrderMapper
|
||||
{
|
||||
/**
|
||||
* 查询采购订单信息
|
||||
*
|
||||
* @param purchaseOrderId 采购订单信息主键
|
||||
* @return 采购订单信息
|
||||
*/
|
||||
public MesPurchaseOrder selectMesPurchaseOrderByPurchaseOrderId(Long purchaseOrderId);
|
||||
|
||||
/**
|
||||
* 查询采购订单信息列表
|
||||
*
|
||||
* @param mesPurchaseOrder 采购订单信息
|
||||
* @return 采购订单信息集合
|
||||
*/
|
||||
public List<MesPurchaseOrder> selectMesPurchaseOrderList(MesPurchaseOrder mesPurchaseOrder);
|
||||
|
||||
/**
|
||||
* 新增采购订单信息
|
||||
*
|
||||
* @param mesPurchaseOrder 采购订单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesPurchaseOrder(MesPurchaseOrder mesPurchaseOrder);
|
||||
|
||||
/**
|
||||
* 修改采购订单信息
|
||||
*
|
||||
* @param mesPurchaseOrder 采购订单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesPurchaseOrder(MesPurchaseOrder mesPurchaseOrder);
|
||||
|
||||
/**
|
||||
* 删除采购订单信息
|
||||
*
|
||||
* @param purchaseOrderId 采购订单信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesPurchaseOrderByPurchaseOrderId(Long purchaseOrderId);
|
||||
|
||||
/**
|
||||
* 批量删除采购订单信息
|
||||
*
|
||||
* @param purchaseOrderIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesPurchaseOrderByPurchaseOrderIds(Long[] purchaseOrderIds);
|
||||
/**
|
||||
* 根据erpid查询
|
||||
* */
|
||||
public MesPurchaseOrder selectMesPurchaseOrderByErpId(Long erpId);
|
||||
}
|
@ -0,0 +1,205 @@
|
||||
<?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.hw.jindie.mapper.MesPurchaseOrderMapper">
|
||||
|
||||
<resultMap type="MesPurchaseOrder" id="MesPurchaseOrderResult">
|
||||
<result property="purchaseOrderId" column="purchase_order_id" />
|
||||
<result property="erpId" column="erp_id" />
|
||||
<result property="fentryId" column="fentry_id" />
|
||||
<result property="poNo" column="po_no" />
|
||||
<result property="documentStatus" column="document_status" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="orderAmount" column="order_amount" />
|
||||
<result property="completeAmount" column="complete_amount" />
|
||||
<result property="approveDate" column="approve_date" />
|
||||
<result property="erpModifyDate" column="erp_modify_date" />
|
||||
<result property="planDeliveryDate" column="plan_delivery_date" />
|
||||
<result property="beginDate" column="begin_date" />
|
||||
<result property="endDate" column="end_date" />
|
||||
<result property="orderStatus" column="order_status" />
|
||||
<result property="completeDate" column="complete_date" />
|
||||
<result property="isFlag" column="is_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="unitId" column="unit_id" />
|
||||
<result property="stockUnitId" column="stock_unit_id" />
|
||||
<result property="priceUnitId" column="price_unit_id" />
|
||||
<result property="auxPropId" column="aux_prop_id" />
|
||||
<result property="srcBillNo" column="src_bill_no" />
|
||||
<result property="tondBase" column="tond_base" />
|
||||
<result property="purchaseOrgId" column="purchase_org_id" />
|
||||
<result property="supplierId" column="supplier_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesPurchaseOrderVo">
|
||||
select purchase_order_id, erp_id, fentry_id, po_no, document_status,
|
||||
material_id, material_code, material_name, order_amount, complete_amount,
|
||||
approve_date, erp_modify_date, plan_delivery_date, begin_date, end_date, order_status,
|
||||
complete_date, is_flag, remark, create_by, create_time, update_by, update_time ,unit_id,
|
||||
stock_unit_id,price_unit_id,aux_prop_id,src_bill_no,tond_base,purchase_org_id,supplier_id
|
||||
from mes_purchase_order
|
||||
</sql>
|
||||
|
||||
<select id="selectMesPurchaseOrderList" parameterType="MesPurchaseOrder" resultMap="MesPurchaseOrderResult">
|
||||
<include refid="selectMesPurchaseOrderVo"/>
|
||||
<where>
|
||||
<if test="erpId != null "> and erp_id = #{erpId}</if>
|
||||
<if test="fentryId != null "> and fentry_id = #{fentryId}</if>
|
||||
<if test="poNo != null and poNo != ''"> and po_no = #{poNo}</if>
|
||||
<if test="documentStatus != null and documentStatus != ''"> and document_status = #{documentStatus}</if>
|
||||
<if test="materialId != null "> and material_id = #{materialId}</if>
|
||||
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
<if test="orderAmount != null "> and order_amount = #{orderAmount}</if>
|
||||
<if test="completeAmount != null "> and complete_amount = #{completeAmount}</if>
|
||||
<if test="approveDate != null "> and approve_date = #{approveDate}</if>
|
||||
<if test="erpModifyDate != null "> and erp_modify_date = #{erpModifyDate}</if>
|
||||
<if test="planDeliveryDate != null "> and plan_delivery_date = #{planDeliveryDate}</if>
|
||||
<if test="beginDate != null "> and begin_date = #{beginDate}</if>
|
||||
<if test="endDate != null "> and end_date = #{endDate}</if>
|
||||
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
|
||||
<if test="completeDate != null "> and complete_date = #{completeDate}</if>
|
||||
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
|
||||
<if test="unitId != null and unitId != ''"> and unit_id = #{unitId}</if>
|
||||
<if test="stockUnitId != null and stockUnitId != ''"> and stock_unit_id = #{stockUnitId}</if>
|
||||
<if test="priceUnitId != null and priceUnitId != ''"> and price_unit_id = #{priceUnitId}</if>
|
||||
<if test="auxPropId != null and auxPropId != ''"> and aux_prop_id = #{auxPropId}</if>
|
||||
<if test="srcBillNo != null and srcBillNo != ''"> and src_bill_no = #{srcBillNo}</if>
|
||||
<if test="tondBase != null and tondBase != ''"> and tond_base = #{tondBase}</if>
|
||||
<if test="purchaseOrgId != null and purchaseOrgId != ''"> and purchase_org_id = #{purchaseOrgId}</if>
|
||||
<if test="supplierId != null and supplierId != ''"> and supplier_id = #{supplierId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesPurchaseOrderByPurchaseOrderId" parameterType="Long" resultMap="MesPurchaseOrderResult">
|
||||
<include refid="selectMesPurchaseOrderVo"/>
|
||||
where purchase_order_id = #{purchaseOrderId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesPurchaseOrder" parameterType="MesPurchaseOrder" useGeneratedKeys="true" keyProperty="purchaseOrderId">
|
||||
insert into mes_purchase_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="erpId != null">erp_id,</if>
|
||||
<if test="fentryId != null">fentry_id,</if>
|
||||
<if test="poNo != null">po_no,</if>
|
||||
<if test="documentStatus != null">document_status,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="materialCode != null and materialCode != ''">material_code,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="orderAmount != null">order_amount,</if>
|
||||
<if test="completeAmount != null">complete_amount,</if>
|
||||
<if test="approveDate != null">approve_date,</if>
|
||||
<if test="erpModifyDate != null">erp_modify_date,</if>
|
||||
<if test="planDeliveryDate != null">plan_delivery_date,</if>
|
||||
<if test="beginDate != null">begin_date,</if>
|
||||
<if test="endDate != null">end_date,</if>
|
||||
<if test="orderStatus != null">order_status,</if>
|
||||
<if test="completeDate != null">complete_date,</if>
|
||||
<if test="isFlag != null and isFlag != ''">is_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="unitId != null">unit_id,</if>
|
||||
<if test="stockUnitId != null">stock_unit_id,</if>
|
||||
<if test="priceUnitId != null">price_unit_id,</if>
|
||||
<if test="auxPropId != null">aux_prop_id,</if>
|
||||
<if test="srcBillNo != null">src_bill_no,</if>
|
||||
<if test="tondBase != null">tond_base,</if>
|
||||
<if test="purchaseOrgId != null">purchase_org_id,</if>
|
||||
<if test="supplierId != null">supplier_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="erpId != null">#{erpId},</if>
|
||||
<if test="fentryId != null">#{fentryId},</if>
|
||||
<if test="poNo != null">#{poNo},</if>
|
||||
<if test="documentStatus != null">#{documentStatus},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="orderAmount != null">#{orderAmount},</if>
|
||||
<if test="completeAmount != null">#{completeAmount},</if>
|
||||
<if test="approveDate != null">#{approveDate},</if>
|
||||
<if test="erpModifyDate != null">#{erpModifyDate},</if>
|
||||
<if test="planDeliveryDate != null">#{planDeliveryDate},</if>
|
||||
<if test="beginDate != null">#{beginDate},</if>
|
||||
<if test="endDate != null">#{endDate},</if>
|
||||
<if test="orderStatus != null">#{orderStatus},</if>
|
||||
<if test="completeDate != null">#{completeDate},</if>
|
||||
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="unitId != null">#{unitId},</if>
|
||||
<if test="stockUnitId != null">#{stockUnitId},</if>
|
||||
<if test="priceUnitId != null">#{priceUnitId},</if>
|
||||
<if test="auxPropId != null">#{auxPropId},</if>
|
||||
<if test="srcBillNo != null">#{srcBillNo},</if>
|
||||
<if test="tondBase != null">#{tondBase},</if>
|
||||
<if test="purchaseOrgId != null">#{purchaseOrgId},</if>
|
||||
<if test="supplierId != null">#{supplierId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesPurchaseOrder" parameterType="MesPurchaseOrder">
|
||||
update mes_purchase_order
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="erpId != null">erp_id = #{erpId},</if>
|
||||
<if test="fentryId != null">fentry_id = #{fentryId},</if>
|
||||
<if test="poNo != null">po_no = #{poNo},</if>
|
||||
<if test="documentStatus != null">document_status = #{documentStatus},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="orderAmount != null">order_amount = #{orderAmount},</if>
|
||||
<if test="completeAmount != null">complete_amount = #{completeAmount},</if>
|
||||
<if test="approveDate != null">approve_date = #{approveDate},</if>
|
||||
<if test="erpModifyDate != null">erp_modify_date = #{erpModifyDate},</if>
|
||||
<if test="planDeliveryDate != null">plan_delivery_date = #{planDeliveryDate},</if>
|
||||
<if test="beginDate != null">begin_date = #{beginDate},</if>
|
||||
<if test="endDate != null">end_date = #{endDate},</if>
|
||||
<if test="orderStatus != null">order_status = #{orderStatus},</if>
|
||||
<if test="completeDate != null">complete_date = #{completeDate},</if>
|
||||
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="unitId != null">unit_id=#{unitId},</if>
|
||||
<if test="stockUnitId != null">stock_unit_id=#{stockUnitId},</if>
|
||||
<if test="priceUnitId != null">price_unit_id=#{priceUnitId},</if>
|
||||
<if test="auxPropId != null">aux_prop_id=#{auxPropId},</if>
|
||||
<if test="srcBillNo != null">src_bill_no=#{srcBillNo},</if>
|
||||
<if test="tondBase != null">tond_base=#{tondBase},</if>
|
||||
<if test="purchaseOrgId != null">purchase_org_id=#{purchaseOrgId},</if>
|
||||
<if test="supplierId != null">supplier_id=#{supplierId},</if>
|
||||
</trim>
|
||||
where purchase_order_id = #{purchaseOrderId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesPurchaseOrderByPurchaseOrderId" parameterType="Long">
|
||||
delete from mes_purchase_order where purchase_order_id = #{purchaseOrderId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesPurchaseOrderByPurchaseOrderIds" parameterType="String">
|
||||
delete from mes_purchase_order where purchase_order_id in
|
||||
<foreach item="purchaseOrderId" collection="array" open="(" separator="," close=")">
|
||||
#{purchaseOrderId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectMesPurchaseOrderByErpId" parameterType="Long" resultMap="MesPurchaseOrderResult">
|
||||
<include refid="selectMesPurchaseOrderVo"/>
|
||||
where erp_id = #{erpId}
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue