@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace= "com.ruoyi.purchase.mapper.PurchaseOrderMapper" >
<resultMap type= "PurchaseOrder" id= "PurchaseOrderResult" >
<resultMap type= "PurchaseOrderVo " id= "PurchaseOrderResult" >
<result property= "purchaseOrderId" column= "purchase_order_id" />
<result property= "purchaseOrderCode" column= "purchase_order_code" />
<result property= "purchaseBuyer" column= "purchase_buyer" />
@ -49,6 +49,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
<sql id= "selectPurchaseOrderVo" >
@ -60,28 +70,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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 from purchase_order
approve_time, standby_one, standby_two,create_time, create_by, update_time, update_by,
instance_id, instance_type, instance_type_name, submit_instance_id, cancel_instance_id,
restore_instance_id, apply_title, apply_user, apply_time
from purchase_order
</sql>
<select id= "selectPurchaseOrderList" parameterType= "PurchaseOrder" resultMap= "PurchaseOrderResult" >
<include refid= "selectPurchaseOrderVo" />
select pur.purchase_order_id, pur.purchase_order_code, pur.supplier_code, pur.supplier_name,
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 >
del_flag = '0'
<if test= "purchaseOrderCode != null and purchaseOrderCode != ''" > and purchase_order_code like concat('%', #{purchaseOrderCode}, '%')</if>
<if test= "purchaseBuyer != null and purchaseBuyer != ''" > and purchase_buyer = #{purchaseBuyer}</if>
pur. del_flag = '0'
<if test= "purchaseOrderCode != null and purchaseOrderCode != ''" > and pur. purchase_order_code like concat('%', #{purchaseOrderCode}, '%')</if>
<if test= "purchaseBuyer != null and purchaseBuyer != ''" > and pur. purchase_buyer = #{purchaseBuyer}</if>
<if test= "supplierCode != null and supplierCode != ''" >
and purchase_order_code in ( select purchase_order_code from purchase_order_child where supplier_code = #{supplierCode})
and pur. purchase_order_code in ( select purchase_order_code from purchase_order_child where supplier_code = #{supplierCode})
</if>
<if test= "supplierName != null and supplierName != ''" >
and purchase_order_code in ( select purchase_order_code from purchase_order_child where supplier_name = #{supplierName})
and pur.purchase_order_code in ( select purchase_order_code from purchase_order_child where supplier_name = #{supplierName})
</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>
<if test= "useStatus != null and useStatus != ''" > and use_status = #{useStatus}</if>
<if test= "eceiptStatus != null and eceiptStatus !='' " > and eceipt_status = #{eceiptStatus}</if>
<if test= "paymentStatus != null and paymentStatus != '' " > and payment_status = #{paymentStatus}</if>
<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>
</where>
order by purchase_order_id desc
order by pur.create_time desc
</select>
<select id= "selectPurchaseOrderById" parameterType= "Long" resultMap= "PurchaseOrderResult" >
@ -126,6 +163,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "rmbSum != null" > rmbSum,</if>
<if test= "createTime != null" > create_time,</if>
<if test= "createBy != null" > create_by,</if>
<if test= "instanceId != null" > instance_id,</if>
<if test= "instanceType != null" > instance_type,</if>
<if test= "submitInstanceId != null" > submit_instance_id,</if>
<if test= "cancelInstanceId != null" > cancel_instance_id,</if>
<if test= "restoreInstanceId != null" > restore_instance_id,</if>
<if test= "applyTitle != null" > apply_title,</if>
<if test= "applyUser != null" > apply_user,</if>
<if test= "applyTime != null" > apply_time,</if>
<if test= "auditUser != null" > audit_user,</if>
<if test= "delFlag != null" > del_flag,</if>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
@ -163,6 +209,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "rmbSum != null" > #{rmbSum},</if>
<if test= "createTime != null" > #{createTime},</if>
<if test= "createBy != null" > #{createBy},</if>
<if test= "instanceId != null" > #{instanceId},</if>
<if test= "instanceType != null" > #{instanceType},</if>
<if test= "submitInstanceId != null" > #{submitInstanceId},</if>
<if test= "cancelInstanceId != null" > #{cancelInstanceId},</if>
<if test= "restoreInstanceId != null" > #{restoreInstanceId},</if>
<if test= "applyTitle != null" > #{applyTitle},</if>
<if test= "applyUser != null" > #{applyUser},</if>
<if test= "applyTime != null" > #{applyTime},</if>
<if test= "delFlag != null" > #{delFlag},</if>
</trim>
</insert>
@ -208,8 +262,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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= "updateTime !=null" > update_time = #{updateTime},</if>
<if test= "updateBy !=null" > update_by = #{updateBy},</if>
<if test= "instanceId != null" > instance_id = #{instanceId},</if>
<if test= "instanceType != null" > instance_type = #{instanceType},</if>
<if test= "submitInstanceId != null" > submit_instance_id = #{submitInstanceId},</if>
<if test= "cancelInstanceId != null" > cancel_instance_id = #{cancelInstanceId},</if>
<if test= "restoreInstanceId != null" > restore_instance_id = #{restoreInstanceId},</if>
<if test= "applyTitle != null" > apply_title = #{applyTitle},</if>
<if test= "applyUser != null" > apply_user = #{applyUser},</if>
<if test= "applyTime != null" > apply_time = #{applyTime},</if>
<if test= "delFlag != null" > del_flag = #{delFlag},</if>
</trim>
where purchase_order_id = #{purchaseOrderId}
</update>
@ -240,4 +305,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where purchase_order_code = #{purchaseOrderCode}
</select>
<delete id= "deleteSysCustomerQuoteByIds" parameterType= "String" >
update sys_customer_quote set use_status = '1' sys_customer_quote where id in
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
</delete>
</mapper>