|
|
@@ -109,9 +109,9 @@
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
This element was generated on Fri May 17 09:46:50 CST 2019.
|
|
|
-->
|
|
|
- id, order_no, type, status, reject_reason, remarks, invoice_type, unit_name, tax_number,
|
|
|
- amount, banks, content, unit_address, invoice_remarks, unit_mobile, voucher_url,
|
|
|
- post, addressee, addressee_mobile, addressee_province, addressee_city, addressee_area,
|
|
|
+ id, order_no, type, status, reject_reason, remarks, invoice_type, unit_name, tax_number,
|
|
|
+ amount, banks, content, unit_address, invoice_remarks, unit_mobile, voucher_url,
|
|
|
+ post, addressee, addressee_mobile, addressee_province, addressee_city, addressee_area,
|
|
|
recipient_address, create_time, update_time, approval, already_amount
|
|
|
</sql>
|
|
|
<select id="selectByExample" parameterType="com.goafanti.common.model.TOrderInvoiceExample" resultMap="BaseResultMap">
|
|
|
@@ -139,7 +139,7 @@
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
This element was generated on Fri May 17 09:46:50 CST 2019.
|
|
|
-->
|
|
|
- select
|
|
|
+ select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from t_order_invoice
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
@@ -170,28 +170,28 @@
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
This element was generated on Fri May 17 09:46:50 CST 2019.
|
|
|
-->
|
|
|
- insert into t_order_invoice (id, order_no, type,
|
|
|
- status, reject_reason, remarks,
|
|
|
- invoice_type, unit_name, tax_number,
|
|
|
- amount, banks, content,
|
|
|
- unit_address, invoice_remarks, unit_mobile,
|
|
|
- voucher_url, post, addressee,
|
|
|
- addressee_mobile, addressee_province, addressee_city,
|
|
|
- addressee_area, recipient_address, create_time,
|
|
|
+ insert into t_order_invoice (id, order_no, type,
|
|
|
+ status, reject_reason, remarks,
|
|
|
+ invoice_type, unit_name, tax_number,
|
|
|
+ amount, banks, content,
|
|
|
+ unit_address, invoice_remarks, unit_mobile,
|
|
|
+ voucher_url, post, addressee,
|
|
|
+ addressee_mobile, addressee_province, addressee_city,
|
|
|
+ addressee_area, recipient_address, create_time,
|
|
|
update_time, approval, already_amount
|
|
|
)
|
|
|
- values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
|
|
|
- #{status,jdbcType=INTEGER}, #{rejectReason,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},
|
|
|
- #{invoiceType,jdbcType=INTEGER}, #{unitName,jdbcType=VARCHAR}, #{taxNumber,jdbcType=VARCHAR},
|
|
|
- #{amount,jdbcType=DECIMAL}, #{banks,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
|
|
|
- #{unitAddress,jdbcType=VARCHAR}, #{invoiceRemarks,jdbcType=VARCHAR}, #{unitMobile,jdbcType=VARCHAR},
|
|
|
- #{voucherUrl,jdbcType=VARCHAR}, #{post,jdbcType=INTEGER}, #{addressee,jdbcType=VARCHAR},
|
|
|
- #{addresseeMobile,jdbcType=VARCHAR}, #{addresseeProvince,jdbcType=INTEGER}, #{addresseeCity,jdbcType=INTEGER},
|
|
|
- #{addresseeArea,jdbcType=INTEGER}, #{recipientAddress,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
|
|
|
+ #{status,jdbcType=INTEGER}, #{rejectReason,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},
|
|
|
+ #{invoiceType,jdbcType=INTEGER}, #{unitName,jdbcType=VARCHAR}, #{taxNumber,jdbcType=VARCHAR},
|
|
|
+ #{amount,jdbcType=DECIMAL}, #{banks,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
|
|
|
+ #{unitAddress,jdbcType=VARCHAR}, #{invoiceRemarks,jdbcType=VARCHAR}, #{unitMobile,jdbcType=VARCHAR},
|
|
|
+ #{voucherUrl,jdbcType=VARCHAR}, #{post,jdbcType=INTEGER}, #{addressee,jdbcType=VARCHAR},
|
|
|
+ #{addresseeMobile,jdbcType=VARCHAR}, #{addresseeProvince,jdbcType=INTEGER}, #{addresseeCity,jdbcType=INTEGER},
|
|
|
+ #{addresseeArea,jdbcType=INTEGER}, #{recipientAddress,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
#{updateTime,jdbcType=TIMESTAMP}, #{approval,jdbcType=INTEGER}, #{alreadyAmount,jdbcType=DECIMAL}
|
|
|
)
|
|
|
</insert>
|
|
|
- <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderInvoice">
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderInvoice" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
|
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
@@ -642,13 +642,13 @@
|
|
|
<select id="financeOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
|
|
|
select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,
|
|
|
ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTime ,a.status,b.process_status processStatus,
|
|
|
- b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a
|
|
|
+ b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a
|
|
|
left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
|
|
|
left join (select order_no,sum(amount)as sumAmount from t_order_invoice where status =2 group by order_no) d
|
|
|
- on a.order_no=d.order_no left join department e on b.order_dep=e.id
|
|
|
- where a.status in (1,2) and a.approval in (0,2)
|
|
|
+ on a.order_no=d.order_no left join department e on b.order_dep=e.id
|
|
|
+ where a.status in (1,2) and a.approval in (0,2)
|
|
|
<if test="type !=null">
|
|
|
- and a.`type`= #{type,jdbcType=INTEGER}
|
|
|
+ and a.`type`= #{type,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="financeId !=null">
|
|
|
and e.finance_id= #{financeId,jdbcType=VARCHAR}
|
|
|
@@ -669,7 +669,7 @@
|
|
|
and a.approval= #{approval,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="aDep !=null">
|
|
|
- and b.order_dep in
|
|
|
+ and b.order_dep in
|
|
|
<foreach collection="aDep" index="index" item="depid" open="(" separator="," close=")">
|
|
|
#{depid}
|
|
|
</foreach>
|
|
|
@@ -679,15 +679,15 @@
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="financeOrderInvoiceCount" resultType="java.lang.Integer">
|
|
|
- select count(*) from t_order_invoice a
|
|
|
- left join t_order_new b on a.order_no=b.order_no
|
|
|
+ select count(*) from t_order_invoice a
|
|
|
+ left join t_order_new b on a.order_no=b.order_no
|
|
|
left join admin c on b.salesman_id=c.id
|
|
|
left join department e on b.order_dep=e.id
|
|
|
- where a.status in (1,2) and a.approval in (0,2)
|
|
|
+ where a.status in (1,2) and a.approval in (0,2)
|
|
|
<if test="type !=null">
|
|
|
- and a.`type`= #{type,jdbcType=INTEGER}
|
|
|
+ and a.`type`= #{type,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="financeId !=null">
|
|
|
and e.finance_id= #{financeId,jdbcType=VARCHAR}
|
|
|
@@ -708,16 +708,16 @@
|
|
|
and a.approval= #{approval,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="aDep !=null">
|
|
|
- and b.order_dep in
|
|
|
+ and b.order_dep in
|
|
|
<foreach collection="aDep" index="index" item="depid" open="(" separator="," close=")">
|
|
|
#{depid}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="salesmanOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
|
|
|
select a.id ,a.order_no as orderNo,b.contract_no contractNo,a.amount,date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
|
|
|
- a.reject_reason as rejectReason,a.status ,a.approval from t_order_invoice a left join t_order_new b
|
|
|
+ a.reject_reason as rejectReason,a.status ,a.approval from t_order_invoice a left join t_order_new b
|
|
|
on a.order_no=b.order_no where a.status !=4
|
|
|
<if test="orderNo !=null">
|
|
|
and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
@@ -727,22 +727,22 @@
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="salesmanOrderInvoiceCount" resultType="java.lang.Integer">
|
|
|
select count(*) from t_order_invoice where status !=4
|
|
|
<if test="orderNo !=null">
|
|
|
and order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="approvalOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
|
|
|
select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,b.process_status processStatus,
|
|
|
ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTime ,a.status, a.approval,
|
|
|
- b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a
|
|
|
+ b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a
|
|
|
left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
|
|
|
left join (select order_no,sum(amount)as sumAmount from t_order_invoice where status =2 group by order_no) d
|
|
|
on a.order_no=d.order_no where 1=1
|
|
|
- <if test="status ==null">
|
|
|
+ <if test="status ==null">
|
|
|
and a.status in(1,2)
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
@@ -777,12 +777,12 @@
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="approvalOrderInvoiceCount" resultType="java.lang.Integer">
|
|
|
- select count(*) from t_order_invoice a
|
|
|
+ select count(*) from t_order_invoice a
|
|
|
left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
|
|
|
where 1=1
|
|
|
- <if test="status ==null">
|
|
|
+ <if test="status ==null">
|
|
|
and a.status in(1,2)
|
|
|
</if>
|
|
|
<if test="status != null">
|
|
|
@@ -813,28 +813,28 @@
|
|
|
and c.department_id= #{aDep,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectByInvoiceDitails" parameterType="java.lang.Integer" resultType="com.goafanti.order.bo.TOrderInvoiceDetails">
|
|
|
select a.id ,a.order_no as orderNo,a.`type`,a.status,a.reject_reason as rejectReason,a.remarks,a.invoice_type as invoiceType,
|
|
|
a.unit_name as unitName,a.tax_number as taxNumber,a.amount,a.banks,a.content,a.unit_address as unitAddress,
|
|
|
a.invoice_remarks as invoiceRemarks,a.unit_mobile as unitMobile,a.voucher_url as voucherUrl ,a.post,a.addressee,
|
|
|
a.addressee_area as addresseeArea,a.addressee_city as addresseeCity,a.addressee_province as addresseeProvince,
|
|
|
a.addressee_mobile as addresseeMobile,a.recipient_address as recipientAddress,a.create_time,a.update_time,a.approval,
|
|
|
- a.already_amount as alreadyAmount,b.contract_no as contractNo from t_order_invoice a
|
|
|
+ a.already_amount as alreadyAmount,b.contract_no as contractNo from t_order_invoice a
|
|
|
left join t_order_new b on a.order_no=b.order_no
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="getInvoiceDetails" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderInvoiceDetails">
|
|
|
select a.id ,a.order_no as orderNo,a.`type`,a.status,a.reject_reason as rejectReason,a.remarks,a.invoice_type as invoiceType,
|
|
|
a.unit_name as unitName,a.tax_number as taxNumber,a.amount,a.banks,a.content,a.unit_address as unitAddress,
|
|
|
a.invoice_remarks as invoiceRemarks,a.unit_mobile as unitMobile,a.voucher_url as voucherUrl ,a.post,a.addressee,
|
|
|
a.addressee_area as addresseeArea,a.addressee_city as addresseeCity,a.addressee_province as addresseeProvince,
|
|
|
a.addressee_mobile as addresseeMobile,a.recipient_address as recipientAddress,a.create_time,a.update_time,a.approval,
|
|
|
- a.already_amount as alreadyAmount,b.contract_no as contractNo from t_order_invoice a
|
|
|
+ a.already_amount as alreadyAmount,b.contract_no as contractNo from t_order_invoice a
|
|
|
left join t_order_new b on a.order_no=b.order_no
|
|
|
where a.order_no= #{orderNo,jdbcType=VARCHAR}
|
|
|
- and a.create_time=(select max(create_time) from t_order_invoice where order_no= #{orderNo,jdbcType=VARCHAR})
|
|
|
+ and a.create_time=(select max(create_time) from t_order_invoice where order_no= #{orderNo,jdbcType=VARCHAR})
|
|
|
</select>
|
|
|
<select id="conutAmountByOrderNo" resultType="java.math.BigDecimal">
|
|
|
select ifnull(sum(a.amount),0) amount from t_order_invoice a
|
|
|
@@ -844,4 +844,10 @@
|
|
|
select date_format(a.create_time,'%Y-%m-%d %H:%i:%S') createTime,a.amount from t_order_invoice a
|
|
|
where a.status=2 and a.order_no= #{orderNo,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+ <select id="selectInvoiceLog" resultType="com.goafanti.order.bo.OutInvoiceLog">
|
|
|
+ select a.id,a.invoice_id invoiceId ,a.status,a.aid,a.create_time createTime,
|
|
|
+ b.name adminName,date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTimes
|
|
|
+ from invoice_log a left join admin b on a.aid =b.id
|
|
|
+ where a.invoice_id =#{id} order by a.create_time
|
|
|
+ </select>
|
|
|
+</mapper>
|