@ -1,125 +1,64 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
< !DOCTYPE mapper
< !DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace= "com.ruoyi.purchase.mapper.PurchaseOrderMapper" >
<mapper namespace= "com.ruoyi.purchase.mapper.PurchaseOrderMapper" >
<resultMap type= "PurchaseOrderVo" id= "PurchaseOrderResult" >
<result property= "purchaseOrderId" column= "purchase_order_id" />
<resultMap type= "PurchaseOrderVo" id= "PurchaseOrderResult" >
<result property= "purchaseOrderCode" column= "purchase_order_code" />
<result property= "purchaseOrderId" column= "purchase_order_id" />
<result property= "purchaseBuyer" column= "purchase_buyer" />
<result property= "purchaseOrderCode" column= "purchase_order_code" />
<result property= "useStatus" column= "use_status" />
<result property= "purchasePlanCode" column= "purchase_plan_code" />
<result property= "auditStatus" column= "audit_status" />
<result property= "warehouseStorageStatus" column= "warehouse_storage_status" />
<result property= "eceiptStatus" column= "eceipt_status" />
<result property= "paymentStatus" column= "payment_status" />
<result property= "paymentStatus" column= "payment_status" />
<result property= "supplierCode" column= "supplier_code" />
<result property= "supplierNum" column= "supplier_num" />
<result property= "supplierName" column= "supplier_name" />
<result property= "materialAmount" column= "material_amount" />
<result property= "materialSum" column= "material_sum" />
<result property= "materialSum" column= "material_sum" />
<result property= "actualPurchaseSum" column= "actual_purchase_sum" />
<result property= "noRmbSum" column= "noRmbSum" />
<result property= "sharedInventoryOccupancySum" column= "shared_inventory_occupancy_sum" />
<result property= "rmbSum" column= "rmbSum" />
<result property= "refundsExchangesSum" column= "refunds_exchanges_sum" />
<result property= "supplierCode" column= "supplier_code" />
<result property= "storageSum" column= "storage_sum" />
<result property= "supplierName" column= "supplier_name" />
<result property= "noRmbSum" column= "noRmb_sum" />
<result property= "eceiptType" column= "eceipt_type" />
<result property= "rmbSum" column= "rmb_sum" />
<result property= "arrivedTime" column= "arrived_time" />
<result property= "eceiptType" column= "eceipt_type" />
<result property= "customerContact" column= "customer_contact" />
<result property= "arrivedTime" column= "arrived_time" />
<result property= "contactNumber" column= "contact_number" />
<result property= "stockNo" column= "stock_no" />
<result property= "customerFax" column= "customer_fax" />
<result property= "stockName" column= "stock_name" />
<result property= "deliveryAddress" column= "delivery_address" />
<result property= "receivePerson" column= "receive_person" />
<result property= "paymentTerms" column= "payment_terms" />
<result property= "receivePersonPhone" column= "receive_person_phone" />
<result property= "deliveryConditions" column= "delivery_conditions" />
<result property= "receiveAddress" column= "receive_address" />
<result property= "deliveryMethod" column= "delivery_method" />
<result property= "purchaseBuyer" column= "purchase_buyer" />
<result property= "purchaseName" column= "purchase_name" />
<result property= "useStatus" column= "use_status" />
<result property= "billingDate" column= "billing_date" />
<result property= "auditStatus" column= "audit_status" />
<result property= "taxRate" column= "tax_rate" />
<result property= "createBy" column= "create_by" />
<result property= "purchaseCategory" column= "purchase_category" />
<result property= "createTime" column= "create_time" />
<result property= "purchaseCommander" column= "purchase_commander" />
<result property= "updateBy" column= "update_by" />
<result property= "customerOrderNumber" column= "customer_order_number" />
<result property= "updateTime" column= "update_time" />
<result property= "remarkContent" column= "remark_content" />
<result property= "delFlag" column= "del_flag" />
<result property= "closeCaseNo" column= "close_case_no" />
<result property= "instanceId" column= "instance_id" />
<result property= "closeCaseName" column= "close_case_name" />
<result property= "instanceType" column= "instance_type" />
<result property= "closeCaseTime" column= "close_case_time" />
<result property= "submitInstanceId" column= "submit_instance_id" />
<result property= "standbyOne" column= "standby_one" />
<result property= "cancelInstanceId" column= "cancel_instance_id" />
<result property= "standbyTwo" column= "standby_two" />
<result property= "restoreInstanceId" column= "restore_instance_id" />
<result property= "delFlag" column= "del_flag" />
<result property= "applyTitle" column= "apply_title" />
<result property= "stockNo" column= "stock_no" />
<result property= "applyUser" column= "apply_user" />
<result property= "stockName" column= "stock_name" />
<result property= "applyTime" column= "apply_time" />
<result property= "stockAddress" column= "stock_address" />
<result property= "stockContact" column= "stock_contact" />
<result property= "stockPhone" column= "stock_phone" />
<result property= "createTime" column= "create_time" />
<result property= "createBy" column= "create_by" />
<result property= "updateTime" column= "update_time" />
<result property= "updateBy" column= "update_by" />
<result property= "instanceId" column= "instance_id" />
<result property= "instanceType" column= "instance_type" />
<result property= "instanceTypeName" column= "instance_type_name" />
<result property= "submitInstanceId" column= "submit_instance_id" />
<result property= "cancelInstanceId" column= "cancel_instance_id" />
<result property= "restoreInstanceId" column= "restore_instance_id" />
<result property= "applyTitle" column= "apply_title" />
<result property= "applyUser" column= "apply_user" />
<result property= "applyTime" column= "apply_time" />
<result property= "delFlag" column= "del_flag" />
</resultMap>
</resultMap>
<sql id= "selectPurchaseOrderVo" >
<sql id= "selectPurchaseOrderVo" >
select purchase_order_id, purchase_order_code, supplier_code, supplier_name,
select purchase_order_id, purchase_order_code, purchase_plan_code, warehouse_storage_status, payment_status, supplier_code, supplier_name, material_sum, actual_purchase_sum, shared_inventory_occupancy_sum, refunds_exchanges_sum, storage_sum, noRmb_sum, rmb_sum, eceipt_type, arrived_time, stock_no, stock_name, receive_person, receive_person_phone, receive_address, purchase_buyer, use_status, audit_status, create_by, create_time, update_by, update_time, del_flag, instance_id, instance_type, submit_instance_id, cancel_instance_id, restore_instance_id, apply_title, apply_user, apply_time from purchase_order
arrived_time, eceipt_type,eceipt_status, payment_status, supplier_num, material_amount,
material_sum, noRmbSum, rmbSum, use_status, audit_status, purchase_buyer,
customer_contact, contact_number, customer_fax, delivery_address, payment_terms,
delivery_conditions, delivery_method, purchase_name, billing_date, tax_rate,
purchase_category, purchase_commander, customer_order_number, remark_content,
close_case_no, close_case_name, close_case_time,confirm_no,confirm_time,confirm_name,
del_flag, stock_no, stock_name, stock_address, stock_contact, stock_phone,
approve_time, standby_one, standby_two,create_time, create_by, update_time, update_by,
instance_id, instance_type, submit_instance_id, cancel_instance_id,
restore_instance_id, apply_title, apply_user, apply_time
from purchase_order
</sql>
</sql>
<select id= "selectPurchaseOrderList" parameterType= "PurchaseOrder" resultMap= "PurchaseOrderResult" >
<select id= "selectPurchaseOrderList" parameterType= "PurchaseOrder" resultMap= "PurchaseOrderResult" >
select pur.purchase_order_id, pur.purchase_order_code, pur.supplier_code, pur.supplier_name,
<include refid= "selectPurchaseOrderVo" />
pur.arrived_time, pur.eceipt_type, pur.eceipt_status, pur.payment_status, pur.supplier_num, pur.material_amount,
pur.material_sum, pur.noRmbSum, pur.rmbSum, pur.use_status, pur.audit_status, pur.purchase_buyer,
pur.customer_contact, pur.contact_number, pur.customer_fax, pur.delivery_address, pur.payment_terms,
pur.delivery_conditions, pur.delivery_method, pur.purchase_name, pur.billing_date, pur.tax_rate,
pur.purchase_category, pur.purchase_commander, pur.customer_order_number, pur.remark_content,
pur.close_case_no, pur.close_case_name, pur.close_case_time, pur.del_flag, pur.stock_no, pur.stock_name,
pur.stock_address, pur.stock_contact, pur.stock_phone, pur.create_time, pur.create_by, pur.update_time, pur.update_by,
pur.instance_id, pur.instance_type, p.dict_label as instance_type_name, pur.submit_instance_id, pur.cancel_instance_id,
pur.restore_instance_id, pur.apply_title, pur.apply_user, pur.apply_time
from purchase_order as pur
left join(
select dict_value,dict_label from sys_dict_data
where dict_type = 'processType'
) as p
on pur.instance_type = p.dict_value
<where >
<where >
pur.del_flag = '0'
<if test= "purchaseOrderCode != null and purchaseOrderCode != ''" > and purchase_order_code like concat('%', #{purchaseOrderCode}, '%')</if>
<if test= "purchaseOrderCode != null and purchaseOrderCode != ''" > and pur.purchase_order_code like concat('%', #{purchaseOrderCode}, '%')</if>
<if test= "purchasePlanCode != null and purchasePlanCode != ''" > and purchase_plan_code = #{purchasePlanCode}</if>
<if test= "purchaseBuyer != null and purchaseBuyer != ''" > and pur.purchase_buyer = #{purchaseBuyer}</if>
<if test= "warehouseStorageStatus != null and warehouseStorageStatus != ''" > and warehouse_storage_status = #{warehouseStorageStatus}</if>
<if test= "supplierCode != null and supplierCode != ''" >
<if test= "paymentStatus != null and paymentStatus != ''" > and payment_status = #{paymentStatus}</if>
and pur.purchase_order_code in ( select purchase_order_code from purchase_order_child where supplier_code = #{supplierCode})
<if test= "supplierCode != null and supplierCode != ''" > and supplier_code like concat('%', #{supplierCode}, '%')</if>
</if>
<if test= "supplierName != null and supplierName != ''" > and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test= "supplierName != null and supplierName != ''" >
<if test= "params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''" > and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
and pur.purchase_order_code in ( select purchase_order_code from purchase_order_child where supplier_name = #{supplierName})
</if>
<if test= "auditStatus != null and auditStatus != ''" > and pur.audit_status = #{auditStatus}</if>
<if test= "useStatus != null and useStatus != ''" > and pur.use_status = #{useStatus}</if>
<if test= "eceiptStatus != null and eceiptStatus !='' " > and pur.eceipt_status = #{eceiptStatus}</if>
<if test= "paymentStatus != null and paymentStatus != '' " > and pur.payment_status = #{paymentStatus}</if>
<if test= "instanceId != null and instanceId != ''" > and pur.instance_id = #{instanceId}</if>
<if test= "instanceType != null and instanceType != ''" > and pur.instance_type = #{instanceType}</if>
<if test= "submitInstanceId != null and submitInstanceId != ''" > and pur.submit_instance_id = #{submitInstanceId}</if>
<if test= "cancelInstanceId != null and cancelInstanceId != ''" > and pur.cancel_instance_id = #{cancelInstanceId}</if>
<if test= "restoreInstanceId != null and restoreInstanceId != ''" > and pur.restore_instance_id = #{restoreInstanceId}</if>
<if test= "applyTitle != null and applyTitle != ''" > and pur.apply_title = #{applyTitle}</if>
<if test= "applyUser != null and applyUser != ''" > and pur.apply_user = #{applyUser}</if>
<if test= "applyTime != null " > and pur.apply_time = #{applyTime}</if>
<if test= "params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''" >
and pur.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
</where>
</where>
order by pur.audit_status asc, pur.create_time desc
</select>
</select>
<select id= "selectPurchaseOrderById" parameterType= "Long" resultMap= "PurchaseOrderResult" >
<select id= "selectPurchaseOrderById" parameterType= "Long" resultMap= "PurchaseOrderResult" >
@ -131,39 +70,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into purchase_order
insert into purchase_order
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "purchaseOrderCode != null" > purchase_order_code,</if>
<if test= "purchaseOrderCode != null" > purchase_order_code,</if>
<if test= "customerContact != null" > customer_contact,</if>
<if test= "purchasePlanCode != null" > purchase_plan_code,</if>
<if test= "contactNumber != null" > contact_number,</if>
<if test= "warehouseStorageStatus != null" > warehouse_storage_status,</if>
<if test= "customerFax != null" > customer_fax,</if>
<if test= "paymentStatus != null" > payment_status,</if>
<if test= "deliveryAddress != null" > delivery_address,</if>
<if test= "supplierCode != null" > supplier_code,</if>
<if test= "paymentTerms != null" > payment_terms,</if>
<if test= "supplierName != null" > supplier_name,</if>
<if test= "deliveryConditions != null" > delivery_conditions,</if>
<if test= "materialSum != null" > material_sum,</if>
<if test= "deliveryMethod != null" > delivery_method,</if>
<if test= "actualPurchaseSum != null" > actual_purchase_sum,</if>
<if test= "purchaseName != null" > purchase_name,</if>
<if test= "sharedInventoryOccupancySum != null" > shared_inventory_occupancy_sum,</if>
<if test= "billingDate != null" > billing_date,</if>
<if test= "refundsExchangesSum != null" > refunds_exchanges_sum,</if>
<if test= "taxRate != null" > tax_rate,</if>
<if test= "storageSum != null" > storage_sum,</if>
<if test= "purchaseCategory != null" > purchase_category,</if>
<if test= "noRmbSum != null" > noRmb_sum,</if>
<if test= "purchaseCommander != null" > purchase_commander,</if>
<if test= "rmbSum != null" > rmb_sum,</if>
<if test= "customerOrderNumber != null" > customer_order_number,</if>
<if test= "eceiptType != null" > eceipt_type,</if>
<if test= "remarkContent != null" > remark_content,</if>
<if test= "standbyOne != null" > standby_one,</if>
<if test= "standbyTwo != null" > standby_two,</if>
<if test= "stockNo!= null" > stock_no,</if>
<if test= "stockName!= null" > stock_name,</if>
<if test= "stockAddress!= null" > stock_address,</if>
<if test= "stockContact!= null" > stock_contact,</if>
<if test= "stockPhone!= null" > stock_phone,</if>
<if test= "arrivedTime != null" > arrived_time,</if>
<if test= "arrivedTime != null" > arrived_time,</if>
<if test= "eceiptStatus != null" > eceipt_status,</if>
<if test= "stockNo != null" > stock_no,</if>
<if test= "stockName != null" > stock_name,</if>
<if test= "receivePerson != null" > receive_person,</if>
<if test= "receivePersonPhone != null" > receive_person_phone,</if>
<if test= "receiveAddress != null" > receive_address,</if>
<if test= "purchaseBuyer != null" > purchase_buyer,</if>
<if test= "useStatus != null" > use_status,</if>
<if test= "useStatus != null" > use_status,</if>
<if test= "auditStatus != null" > audit_status,</if>
<if test= "auditStatus != null" > audit_status,</if>
<if test= "paymentStatus != null" > payment_status,</if>
<if test= "supplierNum != null" > supplier_num,</if>
<if test= "materialAmount != null" > material_amount,</if>
<if test= "materialSum != null" > material_sum,</if>
<if test= "noRmbSum != null" > noRmbSum,</if>
<if test= "rmbSum != null" > rmbSum,</if>
<if test= "createTime != null" > create_time,</if>
<if test= "createBy != null" > create_by,</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= "delFlag != null" > del_flag,</if>
<if test= "instanceId != null" > instance_id,</if>
<if test= "instanceId != null" > instance_id,</if>
<if test= "instanceType != null" > instance_type,</if>
<if test= "instanceType != null" > instance_type,</if>
<if test= "submitInstanceId != null" > submit_instance_id,</if>
<if test= "submitInstanceId != null" > submit_instance_id,</if>
@ -172,43 +105,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "applyTitle != null" > apply_title,</if>
<if test= "applyTitle != null" > apply_title,</if>
<if test= "applyUser != null" > apply_user,</if>
<if test= "applyUser != null" > apply_user,</if>
<if test= "applyTime != null" > apply_time,</if>
<if test= "applyTime != null" > apply_time,</if>
<if test= "delFlag != null" > del_flag,</if>
</trim>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "purchaseOrderCode != null" > #{purchaseOrderCode},</if>
<if test= "purchaseOrderCode != null" > #{purchaseOrderCode},</if>
<if test= "customerContact != null" > #{customerContact},</if>
<if test= "purchasePlanCode != null" > #{purchasePlanCode},</if>
<if test= "contactNumber != null" > #{contactNumber},</if>
<if test= "warehouseStorageStatus != null" > #{warehouseStorageStatus},</if>
<if test= "customerFax != null" > #{customerFax},</if>
<if test= "deliveryAddress != null" > #{deliveryAddress},</if>
<if test= "paymentTerms != null" > #{paymentTerms},</if>
<if test= "deliveryConditions != null" > #{deliveryConditions},</if>
<if test= "deliveryMethod != null" > #{deliveryMethod},</if>
<if test= "purchaseName != null" > #{purchaseName},</if>
<if test= "billingDate != null" > #{billingDate},</if>
<if test= "taxRate != null" > #{taxRate},</if>
<if test= "purchaseCategory != null" > #{purchaseCategory},</if>
<if test= "purchaseCommander != null" > #{purchaseCommander},</if>
<if test= "customerOrderNumber != null" > #{customerOrderNumber},</if>
<if test= "remarkContent != null" > #{remarkContent},</if>
<if test= "standbyOne != null" > #{standbyOne},</if>
<if test= "standbyTwo != null" > #{standbyTwo},</if>
<if test= "stockNo!= null" > #{stockNo},</if>
<if test= "stockName!= null" > #{stockName},</if>
<if test= "stockAddress!= null" > #{stockAddress},</if>
<if test= "stockContact!= null" > #{stockContact},</if>
<if test= "stockPhone!= null" > #{stockPhone},</if>
<if test= "arrivedTime != null" > #{arrivedTime},</if>
<if test= "eceiptStatus != null" > #{eceiptStatus},</if>
<if test= "useStatus != null" > #{useStatus},</if>
<if test= "auditStatus != null" > #{auditStatus},</if>
<if test= "paymentStatus != null" > #{paymentStatus},</if>
<if test= "paymentStatus != null" > #{paymentStatus},</if>
<if test= "supplierNum != null" > #{supplierNum },</if>
<if test= "supplierCode != null" > #{supplierCode},</if>
<if test= "materialAmount != null" > #{materialAmount },</if>
<if test= "supplierName != null" > #{supplierName},</if>
<if test= "materialSum != null" > #{materialSum},</if>
<if test= "materialSum != null" > #{materialSum},</if>
<if test= "actualPurchaseSum != null" > #{actualPurchaseSum},</if>
<if test= "sharedInventoryOccupancySum != null" > #{sharedInventoryOccupancySum},</if>
<if test= "refundsExchangesSum != null" > #{refundsExchangesSum},</if>
<if test= "storageSum != null" > #{storageSum},</if>
<if test= "noRmbSum != null" > #{noRmbSum},</if>
<if test= "noRmbSum != null" > #{noRmbSum},</if>
<if test= "rmbSum != null" > #{rmbSum},</if>
<if test= "rmbSum != null" > #{rmbSum},</if>
<if test= "createTime != null" > #{createTime},</if>
<if test= "eceiptType != null" > #{eceiptType},</if>
<if test= "arrivedTime != null" > #{arrivedTime},</if>
<if test= "stockNo != null" > #{stockNo},</if>
<if test= "stockName != null" > #{stockName},</if>
<if test= "receivePerson != null" > #{receivePerson},</if>
<if test= "receivePersonPhone != null" > #{receivePersonPhone},</if>
<if test= "receiveAddress != null" > #{receiveAddress},</if>
<if test= "purchaseBuyer != null" > #{purchaseBuyer},</if>
<if test= "useStatus != null" > #{useStatus},</if>
<if test= "auditStatus != null" > #{auditStatus},</if>
<if test= "createBy != null" > #{createBy},</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= "delFlag != null" > #{delFlag},</if>
<if test= "instanceId != null" > #{instanceId},</if>
<if test= "instanceId != null" > #{instanceId},</if>
<if test= "instanceType != null" > #{instanceType},</if>
<if test= "instanceType != null" > #{instanceType},</if>
<if test= "submitInstanceId != null" > #{submitInstanceId},</if>
<if test= "submitInstanceId != null" > #{submitInstanceId},</if>
@ -217,55 +143,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "applyTitle != null" > #{applyTitle},</if>
<if test= "applyTitle != null" > #{applyTitle},</if>
<if test= "applyUser != null" > #{applyUser},</if>
<if test= "applyUser != null" > #{applyUser},</if>
<if test= "applyTime != null" > #{applyTime},</if>
<if test= "applyTime != null" > #{applyTime},</if>
<if test= "delFlag != null" > #{delFlag},</if>
</trim>
</trim>
</insert>
</insert>
<update id= "updatePurchaseOrder" parameterType= "PurchaseOrder" >
<update id= "updatePurchaseOrder" parameterType= "PurchaseOrder" >
update purchase_order
update purchase_order
<trim prefix= "SET" suffixOverrides= "," >
<trim prefix= "SET" suffixOverrides= "," >
<if test= "purchaseOrderCode != null" > purchase_order_code = #{purchaseOrderCode},</if>
<if test= "purchaseOrderCode != null" > purchase_order_code = #{purchaseOrderCode},</if>
<if test= "supplierCode != null and supplierCode != ''" > supplier_code = #{supplierCode},</if>
<if test= "purchasePlanCode != null" > purchase_plan_code = #{purchasePlanCode},</if>
<if test= "supplierName != null and supplierName != ''" > supplier_name = #{supplierName},</if>
<if test= "warehouseStorageStatus != null" > warehouse_storage_status = #{warehouseStorageStatus},</if>
<if test= "customerContact != null" > customer_contact = #{customerContact},</if>
<if test= "paymentStatus != null" > payment_status = #{paymentStatus},</if>
<if test= "contactNumber != null" > contact_number = #{contactNumber},</if>
<if test= "supplierCode != null" > supplier_code = #{supplierCode},</if>
<if test= "customerFax != null" > customer_fax = #{customerFax},</if>
<if test= "supplierName != null" > supplier_name = #{supplierName},</if>
<if test= "deliveryAddress != null" > delivery_address = #{deliveryAddress},</if>
<if test= "materialSum != null" > material_sum = #{materialSum},</if>
<if test= "paymentTerms != null" > payment_terms = #{paymentTerms},</if>
<if test= "actualPurchaseSum != null" > actual_purchase_sum = #{actualPurchaseSum},</if>
<if test= "deliveryConditions != null" > delivery_conditions = #{deliveryConditions},</if>
<if test= "sharedInventoryOccupancySum != null" > shared_inventory_occupancy_sum = #{sharedInventoryOccupancySum},</if>
<if test= "deliveryMethod != null" > delivery_method = #{deliveryMethod},</if>
<if test= "refundsExchangesSum != null" > refunds_exchanges_sum = #{refundsExchangesSum},</if>
<if test= "purchaseName != null" > purchase_name = #{purchaseName},</if>
<if test= "storageSum != null" > storage_sum = #{storageSum},</if>
<if test= "billingDate != null" > billing_date = #{billingDate},</if>
<if test= "noRmbSum != null" > noRmb_sum = #{noRmbSum},</if>
<if test= "taxRate != null" > tax_rate = #{taxRate},</if>
<if test= "rmbSum != null" > rmb_sum = #{rmbSum},</if>
<if test= "purchaseCategory != null" > purchase_category = #{purchaseCategory},</if>
<if test= "eceiptType != null" > eceipt_type = #{eceiptType},</if>
<if test= "purchaseCommander != null" > purchase_commander = #{purchaseCommander},</if>
<if test= "customerOrderNumber != null" > customer_order_number = #{customerOrderNumber},</if>
<if test= "remarkContent != null" > remark_content = #{remarkContent},</if>
<if test= "closeCaseNo != null" > close_case_no = #{closeCaseNo},</if>
<if test= "closeCaseName != null" > close_case_name = #{closeCaseName},</if>
<if test= "closeCaseTime != null" > close_case_time = #{closeCaseTime},</if>
<if test= "standbyOne != null" > standby_one = #{standbyOne},</if>
<if test= "standbyTwo != null" > standby_two = #{standbyTwo},</if>
<if test= "delFlag != null" > del_flag = #{delFlag},</if>
<if test= "stockNo!= null" > stock_no = #{stockNo},</if>
<if test= "stockName!= null" > stock_name = #{stockName},</if>
<if test= "stockAddress!= null" > stock_address = #{stockAddress},</if>
<if test= "stockContact!= null" > stock_contact = #{stockContact},</if>
<if test= "stockPhone!= null" > stock_phone = #{stockPhone},</if>
<if test= "arrivedTime != null" > arrived_time = #{arrivedTime},</if>
<if test= "arrivedTime != null" > arrived_time = #{arrivedTime},</if>
<if test= "eceiptStatus != null" > eceipt_status = #{eceiptStatus},</if>
<if test= "stockNo != null" > stock_no = #{stockNo},</if>
<if test= "stockName != null" > stock_name = #{stockName},</if>
<if test= "receivePerson != null" > receive_person = #{receivePerson},</if>
<if test= "receivePersonPhone != null" > receive_person_phone = #{receivePersonPhone},</if>
<if test= "receiveAddress != null" > receive_address = #{receiveAddress},</if>
<if test= "purchaseBuyer != null" > purchase_buyer = #{purchaseBuyer},</if>
<if test= "useStatus != null" > use_status = #{useStatus},</if>
<if test= "useStatus != null" > use_status = #{useStatus},</if>
<if test= "auditStatus != null" > audit_status = #{auditStatus},</if>
<if test= "auditStatus != null" > audit_status = #{auditStatus},</if>
<if test= "paymentStatus != null" > payment_status = #{paymentStatus},</if>
<if test= "createBy != null" > create_by = #{createBy},</if>
<if test= "supplierNum != null" > supplier_num = #{supplierNum},</if>
<if test= "materialAmount != null" > material_amount = #{materialAmount},</if>
<if test= "materialSum != null" > material_sum = #{materialSum},</if>
<if test= "noRmbSum != null" > noRmbSum = #{noRmbSum},</if>
<if test= "rmbSum != null" > rmbSum = #{rmbSum},</if>
<if test= "createBy != null" > create_by= #{createBy},</if>
<if test= "createTime != null" > create_time = #{createTime},</if>
<if test= "createTime != null" > create_time = #{createTime},</if>
<if test= "updateTime !=null" > update_time = #{updateTime},</if>
<if test= "updateBy != null" > update_by = #{updateBy},</if>
<if test= "updateBy !=null" > update_by = #{updateBy},</if>
<if test= "updateTime != null" > update_time = #{updateTime},</if>
<if test= "delFlag != null" > del_flag = #{delFlag},</if>
<if test= "instanceId != null" > instance_id = #{instanceId},</if>
<if test= "instanceId != null" > instance_id = #{instanceId},</if>
<if test= "instanceType != null" > instance_type = #{instanceType},</if>
<if test= "instanceType != null" > instance_type = #{instanceType},</if>
<if test= "submitInstanceId != null" > submit_instance_id = #{submitInstanceId},</if>
<if test= "submitInstanceId != null" > submit_instance_id = #{submitInstanceId},</if>
@ -274,7 +185,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "applyTitle != null" > apply_title = #{applyTitle},</if>
<if test= "applyTitle != null" > apply_title = #{applyTitle},</if>
<if test= "applyUser != null" > apply_user = #{applyUser},</if>
<if test= "applyUser != null" > apply_user = #{applyUser},</if>
<if test= "applyTime != null" > apply_time = #{applyTime},</if>
<if test= "applyTime != null" > apply_time = #{applyTime},</if>
<if test= "delFlag != null" > del_flag = #{delFlag},</if>
</trim>
</trim>
where purchase_order_id = #{purchaseOrderId}
where purchase_order_id = #{purchaseOrderId}
</update>
</update>
@ -282,9 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id= "deletePurchaseOrderById" parameterType= "Long" >
<delete id= "deletePurchaseOrderById" parameterType= "Long" >
delete from purchase_order where purchase_order_id = #{purchaseOrderId}
delete from purchase_order where purchase_order_id = #{purchaseOrderId}
</delete>
</delete>
<select id= "checkPurchaseOrderCodeUnique" resultType= "java.lang.Integer" >
select count(1) from purchase_order where purchase_ordre_code = #{purchaseOrderCode} limit 1
</select>
<delete id= "deletePurchaseOrderByIds" parameterType= "String" >
<delete id= "deletePurchaseOrderByIds" parameterType= "String" >
delete from purchase_order where purchase_order_id in
delete from purchase_order where purchase_order_id in
<foreach item= "purchaseOrderId" collection= "array" open= "(" separator= "," close= ")" >
<foreach item= "purchaseOrderId" collection= "array" open= "(" separator= "," close= ")" >
@ -292,24 +200,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</foreach>
</delete>
</delete>
<!-- <select id="selectCountByDay" resultType="Integer"> -->
<update id= "cancelPurchaseOrderById" parameterType= "Long" >
<!-- select count(*) from purchase_order where to_days(billing_date) = to_days(now()); -->
update purchase_order set del_flag = '1' where purchase_order_id = #{purchaseOrderId}
<!-- </select> -->
</update>
<select id= "selectOrderByIdDesc" resultMap= "PurchaseOrderResult" >
<include refid= "selectPurchaseOrderVo" />
WHERE purchase_order_code like '%PO%' ORDER BY purchase_order_id DESC
</select>
<select id= "selectPurchaseOrderByOrderCode" parameterType= "String" resultMap= "PurchaseOrderResult" >
<include refid= "selectPurchaseOrderVo" />
where purchase_order_code = #{purchaseOrderCode}
</select>
<delete id= "deleteSysCustomerQuoteByIds" parameterType= "String" >
<update id= "restorePurchaseOrderById" parameterType= "Long" >
update sys_customer_quote set use_status = '1' sys_customer_quote where id in
update purchase_order set del_flag = '0' where purchase_order_id = #{purchaseOrderId}
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
</update>
#{id}
</foreach>
</delete>
</mapper>
</mapper>