|
|
@@ -37,6 +37,12 @@
|
|
|
<result column="contract_picture_url" jdbcType="VARCHAR" property="contractPictureUrl" />
|
|
|
<result column="first_amount" jdbcType="DECIMAL" property="firstAmount" />
|
|
|
<result column="examine_name" jdbcType="VARCHAR" property="examineName" />
|
|
|
+ <result column="cw_indirect_cost" jdbcType="DECIMAL" property="cwIndirectCost" />
|
|
|
+ <result column="contacts" jdbcType="VARCHAR" property="contacts" />
|
|
|
+ <result column="contact_mobile" jdbcType="VARCHAR" property="contactMobile" />
|
|
|
+ <result column="manager_contacts" jdbcType="VARCHAR" property="managerContacts" />
|
|
|
+ <result column="manager_contact_mobile" jdbcType="VARCHAR" property="managerContactMobile" />
|
|
|
+
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
id, order_no, process_state, `status`, `type`, create_time, remarks, voucher_url,
|
|
|
@@ -44,7 +50,8 @@
|
|
|
zxs_cost, zxs_remarks, payment_time, payment_amount, invoice_time, invoice_amount,
|
|
|
invoice_type, cw_cost, refundable_amount, cw_remarks, estimate_cost, estimate_refundable,
|
|
|
refund_Invoice, used_order, refund_status, refund_url, back_status, attachment_url,
|
|
|
- contract_picture_url, first_amount, examine_name
|
|
|
+ contract_picture_url, first_amount, examine_name,cw_indirect_cost,contacts,contact_mobile,
|
|
|
+ manager_contacts,manager_contact_mobile
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -68,7 +75,8 @@
|
|
|
estimate_refundable, refund_Invoice, used_order,
|
|
|
refund_status, refund_url, back_status,
|
|
|
attachment_url, contract_picture_url, first_amount,
|
|
|
- examine_name)
|
|
|
+ examine_name,cw_indirect_cost,contacts,contact_mobile,
|
|
|
+ manager_contacts,manager_contact_mobile)
|
|
|
values (#{orderNo,jdbcType=VARCHAR}, #{processState,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
|
|
|
#{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR},
|
|
|
#{voucherUrl,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, #{settlementAmount,jdbcType=DECIMAL},
|
|
|
@@ -80,7 +88,8 @@
|
|
|
#{estimateRefundable,jdbcType=DECIMAL}, #{refundInvoice,jdbcType=DECIMAL}, #{usedOrder,jdbcType=VARCHAR},
|
|
|
#{refundStatus,jdbcType=INTEGER}, #{refundUrl,jdbcType=VARCHAR}, #{backStatus,jdbcType=INTEGER},
|
|
|
#{attachmentUrl,jdbcType=VARCHAR}, #{contractPictureUrl,jdbcType=VARCHAR}, #{firstAmount,jdbcType=DECIMAL},
|
|
|
- #{examineName,jdbcType=VARCHAR})
|
|
|
+ #{examineName,jdbcType=VARCHAR},#{cwIndirectCost,jdbcType=DECIMAL},#{contacts,jdbcType=VARCHAR},#{contactMobile,jdbcType=VARCHAR},
|
|
|
+ #{managerContacts,jdbcType=VARCHAR},#{managerContactMobile,jdbcType=VARCHAR})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.NewOrderChange" useGeneratedKeys="true">
|
|
|
insert into new_order_change
|
|
|
@@ -187,6 +196,21 @@
|
|
|
<if test="examineName != null">
|
|
|
examine_name,
|
|
|
</if>
|
|
|
+ <if test="cwIndirectCost != null">
|
|
|
+ cw_indirect_cost,
|
|
|
+ </if>
|
|
|
+ <if test="contacts != null">
|
|
|
+ contacts,
|
|
|
+ </if>
|
|
|
+ <if test="contactMobile != null">
|
|
|
+ contact_mobile,
|
|
|
+ </if>
|
|
|
+ <if test="managerContacts != null">
|
|
|
+ manager_contacts,
|
|
|
+ </if>
|
|
|
+ <if test="managerContactMobile != null">
|
|
|
+ manager_contact_mobile,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="orderNo != null">
|
|
|
@@ -291,6 +315,21 @@
|
|
|
<if test="examineName != null">
|
|
|
#{examineName,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="cwIndirectCost != null">
|
|
|
+ #{cwIndirectCost,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="contacts != null">
|
|
|
+ #{contacts,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="contactMobile != null">
|
|
|
+ #{contactMobile,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="managerContacts != null">
|
|
|
+ #{managerContacts,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="managerContactMobile != null">
|
|
|
+ #{managerContactMobile,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.NewOrderChange">
|
|
|
@@ -398,6 +437,21 @@
|
|
|
<if test="examineName != null">
|
|
|
examine_name = #{examineName,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="cwIndirectCost != null">
|
|
|
+ cw_indirect_cost=#{cwIndirectCost,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="contacts != null">
|
|
|
+ contacts=#{contacts,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="contactMobile != null">
|
|
|
+ contact_mobile=#{contactMobile,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="managerContacts != null">
|
|
|
+ manager_contacts=#{managerContacts,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="managerContactMobile != null">
|
|
|
+ manager_contact_mobile=#{managerContactMobile,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
@@ -436,7 +490,12 @@
|
|
|
attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
|
|
|
contract_picture_url = #{contractPictureUrl,jdbcType=VARCHAR},
|
|
|
first_amount = #{firstAmount,jdbcType=DECIMAL},
|
|
|
- examine_name = #{examineName,jdbcType=VARCHAR}
|
|
|
+ examine_name = #{examineName,jdbcType=VARCHAR},
|
|
|
+ cw_indirect_cost=#{cwIndirectCost,jdbcType=DECIMAL},
|
|
|
+ contacts=#{contacts,jdbcType=VARCHAR},
|
|
|
+ contact_mobile=#{contactMobile,jdbcType=VARCHAR},
|
|
|
+ manager_contacts=#{managerContacts,jdbcType=VARCHAR},
|
|
|
+ manager_contact_mobile=#{managerContactMobile,jdbcType=VARCHAR}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
<select id="selectByorderNo" resultType="com.goafanti.order.bo.NewOrderChangeBo">
|
|
|
@@ -447,7 +506,12 @@ select
|
|
|
a.change_amount changeAmount, a.applicant, a.dep_name depName, a.project_state projectState, a.zxs_cost zxsCost,
|
|
|
a.zxs_remarks zxsRemarks, date_format(a.payment_time, '%Y-%m-%d')paymentTimes, a.payment_amount paymentAmount,
|
|
|
date_format(a. invoice_time, '%Y-%m-%d') invoiceTimes, a.invoice_amount invoiceAmount,a.invoice_type invoiceType,
|
|
|
- a.cw_remarks cwRemarks,a.contract_picture_url contractPictureUrl,a.first_amount firstAmount,a.examine_name examineName
|
|
|
+ a.cw_remarks cwRemarks,a.contract_picture_url contractPictureUrl,a.first_amount firstAmount,a.examine_name examineName,
|
|
|
+ a.cw_indirect_cost cwIndirectCost,
|
|
|
+ a.contacts contacts,
|
|
|
+ a.contact_mobile contactMobile,
|
|
|
+ a.manager_contacts managerContacts,
|
|
|
+ a.manager_contact_mobile managerContactMobile
|
|
|
from new_order_change a where 1 = 1
|
|
|
and a.order_no= #{orderNo}
|
|
|
order by a.create_time desc limit 1
|
|
|
@@ -460,7 +524,12 @@ select
|
|
|
a.change_amount changeAmount, a.applicant, a.dep_name depName, a.project_state projectState, a.zxs_cost zxsCost,
|
|
|
a.zxs_remarks zxsRemarks, date_format(a.payment_time, '%Y-%m-%d')paymentTimes, a.payment_amount paymentAmount,
|
|
|
date_format(a. invoice_time, '%Y-%m-%d') invoiceTimes, a.invoice_amount invoiceAmount,a.invoice_type invoiceType,
|
|
|
- a.cw_remarks cwRemarks,a.back_status backStatus ,a.contract_picture_url contractPictureUrl,a.first_amount firstAmount
|
|
|
+ a.cw_remarks cwRemarks,a.back_status backStatus ,a.contract_picture_url contractPictureUrl,a.first_amount firstAmount,
|
|
|
+ a.cw_indirect_cost cwIndirectCost,
|
|
|
+ a.contacts contacts,
|
|
|
+ a.contact_mobile contactMobile,
|
|
|
+ a.manager_contacts managerContacts,
|
|
|
+ a.manager_contact_mobile managerContactMobile
|
|
|
from new_order_change a where 1 = 1
|
|
|
and a.id= #{ChangeId}
|
|
|
order by a.create_time desc
|
|
|
@@ -474,7 +543,8 @@ select
|
|
|
a.change_amount changeAmount, a.applicant, a.dep_name depName, a.project_state projectState, a.zxs_cost zxsCost,
|
|
|
a.zxs_remarks zxsRemarks, date_format(a.payment_time, '%Y-%m-%d')paymentTimes, a.payment_amount paymentAmount,a.first_amount firstAmount,
|
|
|
date_format(a. invoice_time, '%Y-%m-%d') invoiceTimes, a.invoice_amount invoiceAmount,a.invoice_type invoiceType,
|
|
|
- a.cw_remarks cwRemarks,a.back_status backStatus from new_order_change a where 1 = 1 and status in (0,1,2,3)
|
|
|
+ a.cw_remarks cwRemarks,a.back_status backStatus
|
|
|
+from new_order_change a where 1 = 1 and status in (0,1,2,3)
|
|
|
and a.order_no= #{orderNo}
|
|
|
order by a.create_time desc
|
|
|
</select>
|
|
|
@@ -487,7 +557,12 @@ select
|
|
|
a.change_amount changeAmount, a.applicant, a.dep_name depName, a.project_state projectState, a.zxs_cost zxsCost,a.first_amount firstAmount,
|
|
|
a.zxs_remarks zxsRemarks, date_format(a.payment_time, '%Y-%m-%d')paymentTimes, a.payment_amount paymentAmount,a.examine_name examineName,
|
|
|
date_format(a. invoice_time, '%Y-%m-%d') invoiceTimes, a.invoice_amount invoiceAmount,a.invoice_type invoiceType,
|
|
|
- a.cw_remarks cwRemarks,a.estimate_cost estimateCost,estimate_refundable estimateRefundable,refund_Invoice refundInvoice,a.contract_picture_url contractPictureUrl
|
|
|
+ a.cw_remarks cwRemarks,a.estimate_cost estimateCost,estimate_refundable estimateRefundable,refund_Invoice refundInvoice,a.contract_picture_url contractPictureUrl,
|
|
|
+ a.cw_indirect_cost cwIndirectCost,
|
|
|
+ a.contacts contacts,
|
|
|
+ a.contact_mobile contactMobile,
|
|
|
+ a.manager_contacts managerContacts,
|
|
|
+ a.manager_contact_mobile managerContactMobile
|
|
|
from new_order_change a where 1 = 1 and a.id= #{id}
|
|
|
</select>
|
|
|
<select id="checkOderNo" resultType="java.lang.Integer">
|
|
|
@@ -498,7 +573,12 @@ select
|
|
|
select a.id,a.order_no orderNo,b.contract_no contractNo, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes,c.nickname,b.order_type orderType,
|
|
|
date_format(b.create_time,'%Y-%m-%d %H:%i:%S')establishTimes, b.order_status orderStatus,b.total_amount totalAmount,a.status ,a.examine_name examineName,
|
|
|
b.settlement_amount settlementAmount,(b.total_amount-b.settlement_amount) arrears,d.name salesmanName,e.name depName,a.`type`,
|
|
|
- a.process_state processState,a.back_status backStatus from new_order_change noc left join new_order_change a on noc.id=a.id
|
|
|
+ a.process_state processState,a.back_status backStatus,noc.cw_indirect_cost cwIndirectCost,
|
|
|
+ noc.contacts contacts,
|
|
|
+ noc.contact_mobile contactMobile,
|
|
|
+ noc.manager_contacts managerContacts,
|
|
|
+ noc.manager_contact_mobile managerContactMobile
|
|
|
+ from new_order_change noc left join new_order_change a on noc.id=a.id
|
|
|
left join t_order_new b on a.order_no=b.order_no left join user c on b.buyer_id=c.id left join admin d on b.salesman_id=d.id
|
|
|
left join department e on b.order_dep=e.id
|
|
|
<if test="processState==3">
|
|
|
@@ -776,17 +856,6 @@ select
|
|
|
<select id="getOrderChange" resultType="java.util.Map">
|
|
|
select id,used_order usedOrder from new_order_change where order_no= #{orderNo} order by id desc
|
|
|
</select>
|
|
|
-
|
|
|
-
|
|
|
- <update id="updateExamineName">
|
|
|
- update new_order_change a , t_order_new b ,(select a.department_id depId,group_concat(a.name) name
|
|
|
- from admin a left join user_role b on a.id=b.uid
|
|
|
- left join `role` c on b.rid =c.id
|
|
|
- where c.role_type ='9996' and a.status ='0' and a.department_id = #{depId}
|
|
|
- group by a.department_id ) c
|
|
|
- set a.examine_name =c.name
|
|
|
- where a.order_no =b.order_no and b.order_dep = #{depId} and b.order_dep =c.depId
|
|
|
- </update>
|
|
|
<update id="updateTaskExamineName">
|
|
|
update new_order_change n left join (select c.id
|
|
|
from t_order_new a left join t_order_task b on a.order_no =b.order_no
|