|
|
@@ -3,9 +3,9 @@
|
|
|
<mapper namespace="com.goafanti.common.dao.TOrderNewMapper">
|
|
|
<resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderNew">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
<id column="order_no" jdbcType="VARCHAR" property="orderNo" />
|
|
|
<result column="order_type" jdbcType="INTEGER" property="orderType" />
|
|
|
@@ -37,20 +37,23 @@
|
|
|
<result column="legal_person_tel" jdbcType="VARCHAR" property="legalPersonTel" />
|
|
|
<result column="proof_count" jdbcType="REAL" property="proofCount" />
|
|
|
<result column="proof_aid" jdbcType="VARCHAR" property="proofAid" />
|
|
|
+ <result column="proof_time" jdbcType="TIMESTAMP" property="proofTime" />
|
|
|
+ <result column="proof_status" jdbcType="INTEGER" property="proofStatus" />
|
|
|
+ <result column="order_dep" jdbcType="VARCHAR" property="orderDep" />
|
|
|
</resultMap>
|
|
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.TOrderNew">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
<result column="contract_picture_url" jdbcType="LONGVARCHAR" property="contractPictureUrl" />
|
|
|
</resultMap>
|
|
|
<sql id="Example_Where_Clause">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
<where>
|
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
@@ -82,9 +85,9 @@
|
|
|
</sql>
|
|
|
<sql id="Update_By_Example_Where_Clause">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
<where>
|
|
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
@@ -116,30 +119,30 @@
|
|
|
</sql>
|
|
|
<sql id="Base_Column_List">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
order_no, order_type, creater, create_time, update_time, buyer_id, first_amount,
|
|
|
total_amount, settlement_amount, refund_amount, order_status, liquidation_status,
|
|
|
process_status, project_status, approval, order_remarks, delete_sign, salesman_id,
|
|
|
finance_id, technician_id, sign_time, settlement_time, contract_no, contract_type,
|
|
|
- contacts, contact_mobile, legal_person, legal_person_tel, proof_count, proof_aid,
|
|
|
- proof_time, proof_status
|
|
|
+ contacts, contact_mobile, legal_person, legal_person_tel, proof_count, proof_aid,
|
|
|
+ proof_time, proof_status, order_dep
|
|
|
</sql>
|
|
|
<sql id="Blob_Column_List">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
contract_picture_url
|
|
|
</sql>
|
|
|
<select id="selectByExampleWithBLOBs" parameterType="com.goafanti.common.model.TOrderNewExample" resultMap="ResultMapWithBLOBs">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
select
|
|
|
<if test="distinct">
|
|
|
@@ -158,9 +161,9 @@
|
|
|
</select>
|
|
|
<select id="selectByExample" parameterType="com.goafanti.common.model.TOrderNewExample" resultMap="BaseResultMap">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
select
|
|
|
<if test="distinct">
|
|
|
@@ -177,9 +180,9 @@
|
|
|
</select>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
@@ -190,18 +193,18 @@
|
|
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
delete from t_order_new
|
|
|
where order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</delete>
|
|
|
<delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderNewExample">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
delete from t_order_new
|
|
|
<if test="_parameter != null">
|
|
|
@@ -210,9 +213,9 @@
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.goafanti.common.model.TOrderNew">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
insert into t_order_new (order_no, order_type, creater,
|
|
|
create_time, update_time, buyer_id,
|
|
|
@@ -224,6 +227,7 @@
|
|
|
settlement_time, contract_no, contract_type,
|
|
|
contacts, contact_mobile, legal_person,
|
|
|
legal_person_tel, proof_count, proof_aid,
|
|
|
+ proof_time, proof_status, order_dep,
|
|
|
contract_picture_url)
|
|
|
values (#{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR},
|
|
|
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR},
|
|
|
@@ -235,13 +239,14 @@
|
|
|
#{settlementTime,jdbcType=DATE}, #{contractNo,jdbcType=VARCHAR}, #{contractType,jdbcType=VARCHAR},
|
|
|
#{contacts,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{legalPerson,jdbcType=VARCHAR},
|
|
|
#{legalPersonTel,jdbcType=VARCHAR}, #{proofCount,jdbcType=REAL}, #{proofAid,jdbcType=VARCHAR},
|
|
|
+ #{proofTime,jdbcType=TIMESTAMP}, #{proofStatus,jdbcType=INTEGER}, #{orderDep,jdbcType=VARCHAR},
|
|
|
#{contractPictureUrl,jdbcType=LONGVARCHAR})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderNew">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
insert into t_order_new
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
@@ -335,6 +340,15 @@
|
|
|
<if test="proofAid != null">
|
|
|
proof_aid,
|
|
|
</if>
|
|
|
+ <if test="proofTime != null">
|
|
|
+ proof_time,
|
|
|
+ </if>
|
|
|
+ <if test="proofStatus != null">
|
|
|
+ proof_status,
|
|
|
+ </if>
|
|
|
+ <if test="orderDep != null">
|
|
|
+ order_dep,
|
|
|
+ </if>
|
|
|
<if test="contractPictureUrl != null">
|
|
|
contract_picture_url,
|
|
|
</if>
|
|
|
@@ -430,16 +444,25 @@
|
|
|
<if test="proofAid != null">
|
|
|
#{proofAid,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="proofTime != null">
|
|
|
+ #{proofTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="proofStatus != null">
|
|
|
+ #{proofStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="orderDep != null">
|
|
|
+ #{orderDep,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
<if test="contractPictureUrl != null">
|
|
|
#{contractPictureUrl,jdbcType=LONGVARCHAR},
|
|
|
</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
- <select id="countByExample" parameterType="com.goafanti.common.model.TOrderNewExample" resultType="java.lang.Integer">
|
|
|
+ <select id="countByExample" parameterType="com.goafanti.common.model.TOrderNewExample" resultType="java.lang.Long">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
select count(*) from t_order_new
|
|
|
<if test="_parameter != null">
|
|
|
@@ -448,9 +471,9 @@
|
|
|
</select>
|
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
update t_order_new
|
|
|
<set>
|
|
|
@@ -544,6 +567,15 @@
|
|
|
<if test="record.proofAid != null">
|
|
|
proof_aid = #{record.proofAid,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="record.proofTime != null">
|
|
|
+ proof_time = #{record.proofTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="record.proofStatus != null">
|
|
|
+ proof_status = #{record.proofStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.orderDep != null">
|
|
|
+ order_dep = #{record.orderDep,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
<if test="record.contractPictureUrl != null">
|
|
|
contract_picture_url = #{record.contractPictureUrl,jdbcType=LONGVARCHAR},
|
|
|
</if>
|
|
|
@@ -554,9 +586,9 @@
|
|
|
</update>
|
|
|
<update id="updateByExampleWithBLOBs" parameterType="map">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
update t_order_new
|
|
|
set order_no = #{record.orderNo,jdbcType=VARCHAR},
|
|
|
@@ -589,6 +621,9 @@
|
|
|
legal_person_tel = #{record.legalPersonTel,jdbcType=VARCHAR},
|
|
|
proof_count = #{record.proofCount,jdbcType=REAL},
|
|
|
proof_aid = #{record.proofAid,jdbcType=VARCHAR},
|
|
|
+ proof_time = #{record.proofTime,jdbcType=TIMESTAMP},
|
|
|
+ proof_status = #{record.proofStatus,jdbcType=INTEGER},
|
|
|
+ order_dep = #{record.orderDep,jdbcType=VARCHAR},
|
|
|
contract_picture_url = #{record.contractPictureUrl,jdbcType=LONGVARCHAR}
|
|
|
<if test="_parameter != null">
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
@@ -596,9 +631,9 @@
|
|
|
</update>
|
|
|
<update id="updateByExample" parameterType="map">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
update t_order_new
|
|
|
set order_no = #{record.orderNo,jdbcType=VARCHAR},
|
|
|
@@ -630,16 +665,19 @@
|
|
|
legal_person = #{record.legalPerson,jdbcType=VARCHAR},
|
|
|
legal_person_tel = #{record.legalPersonTel,jdbcType=VARCHAR},
|
|
|
proof_count = #{record.proofCount,jdbcType=REAL},
|
|
|
- proof_aid = #{record.proofAid,jdbcType=VARCHAR}
|
|
|
+ proof_aid = #{record.proofAid,jdbcType=VARCHAR},
|
|
|
+ proof_time = #{record.proofTime,jdbcType=TIMESTAMP},
|
|
|
+ proof_status = #{record.proofStatus,jdbcType=INTEGER},
|
|
|
+ order_dep = #{record.orderDep,jdbcType=VARCHAR}
|
|
|
<if test="_parameter != null">
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
</if>
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderNew">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
update t_order_new
|
|
|
<set>
|
|
|
@@ -731,11 +769,14 @@
|
|
|
proof_aid = #{proofAid,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="proofTime != null">
|
|
|
- proof_time = #{proofTime,jdbcType=DATE},
|
|
|
+ proof_time = #{proofTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
<if test="proofStatus != null">
|
|
|
proof_status = #{proofStatus,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="orderDep != null">
|
|
|
+ order_dep = #{orderDep,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
<if test="contractPictureUrl != null">
|
|
|
contract_picture_url = #{contractPictureUrl,jdbcType=LONGVARCHAR},
|
|
|
</if>
|
|
|
@@ -744,9 +785,9 @@
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.TOrderNew">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
update t_order_new
|
|
|
set order_type = #{orderType,jdbcType=INTEGER},
|
|
|
@@ -778,14 +819,17 @@
|
|
|
legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
|
|
|
proof_count = #{proofCount,jdbcType=REAL},
|
|
|
proof_aid = #{proofAid,jdbcType=VARCHAR},
|
|
|
+ proof_time = #{proofTime,jdbcType=TIMESTAMP},
|
|
|
+ proof_status = #{proofStatus,jdbcType=INTEGER},
|
|
|
+ order_dep = #{orderDep,jdbcType=VARCHAR},
|
|
|
contract_picture_url = #{contractPictureUrl,jdbcType=LONGVARCHAR}
|
|
|
where order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderNew">
|
|
|
<!--
|
|
|
- WARNING - @mbggenerated
|
|
|
+ WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Fri Nov 23 15:27:45 CST 2018.
|
|
|
+ This element was generated on Mon May 06 11:18:39 CST 2019.
|
|
|
-->
|
|
|
update t_order_new
|
|
|
set order_type = #{orderType,jdbcType=INTEGER},
|
|
|
@@ -816,66 +860,71 @@
|
|
|
legal_person = #{legalPerson,jdbcType=VARCHAR},
|
|
|
legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR},
|
|
|
proof_count = #{proofCount,jdbcType=REAL},
|
|
|
- proof_aid = #{proofAid,jdbcType=VARCHAR}
|
|
|
+ proof_aid = #{proofAid,jdbcType=VARCHAR},
|
|
|
+ proof_time = #{proofTime,jdbcType=TIMESTAMP},
|
|
|
+ proof_status = #{proofStatus,jdbcType=INTEGER},
|
|
|
+ order_dep = #{orderDep,jdbcType=VARCHAR}
|
|
|
where order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
|
|
|
<!-- 查看所有待财务管理员分配的订单数据 -->
|
|
|
<select id="getAllUnassignedListOrder" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
|
|
|
select * from (
|
|
|
- select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
|
|
|
+ select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
|
|
|
o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
|
|
|
- ,liquidation_status,o.finance_id as financeId,contract_no as contractNo
|
|
|
+ ,liquidation_status,o.finance_id as financeId,contract_no as contractNo,d.name as departmentName
|
|
|
from t_order_new o
|
|
|
left join `user` u on o.buyer_id = u.id
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
+ left join department d on o.order_dep=d.id
|
|
|
where delete_sign = 0
|
|
|
and order_status = 2
|
|
|
<if test="o.processStatus == 2">
|
|
|
and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="o.processStatus == 3">
|
|
|
- and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="o.processStatus == null or o.processStatus ==''">
|
|
|
- and process_status >= 2
|
|
|
+ and process_status >= 2
|
|
|
</if>
|
|
|
- <if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
+ <if test="o.orderNo != null and o.orderNo != """>
|
|
|
and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.financeId != null and o.financeId != ""'>
|
|
|
+ <if test="o.financeId != null and o.financeId != """>
|
|
|
and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.buyerName != null and o.buyerName != ""'>
|
|
|
- <bind name="n" value="'%' + o.buyerName + '%'"/>
|
|
|
+ <if test="o.buyerName != null and o.buyerName != """>
|
|
|
+ <bind name="n" value="'%' + o.buyerName + '%'" />
|
|
|
and u.nickname like #{n,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
|
|
|
- <bind name="a" value="o.startTime + ' 00:00:00'"/>
|
|
|
- <bind name="b" value="o.endTime + ' 23:59:59'"/>
|
|
|
+ <if test="o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != """>
|
|
|
+ <bind name="a" value="o.startTime + ' 00:00:00'" />
|
|
|
+ <bind name="b" value="o.endTime + ' 23:59:59'" />
|
|
|
and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
union
|
|
|
- select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
|
|
|
+ select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
|
|
|
o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
|
|
|
- ,liquidation_status ,o.finance_id as financeId,contract_no as contractNo
|
|
|
+ ,liquidation_status ,o.finance_id as financeId,contract_no as contractNo,d.name as departmentName
|
|
|
from t_order_new o
|
|
|
left join `user` u on o.buyer_id = u.id
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
+ left join department d on o.order_dep=d.id
|
|
|
where delete_sign = 0 and approval = 2 and finance_id is null and order_status = 2
|
|
|
- <if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
+ <if test="o.orderNo != null and o.orderNo != """>
|
|
|
and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.financeId != null and o.financeId != ""'>
|
|
|
+ <if test="o.financeId != null and o.financeId != """>
|
|
|
and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.buyerName != null and o.buyerName != ""'>
|
|
|
- <bind name="n" value="'%' + o.buyerName + '%'"/>
|
|
|
+ <if test="o.buyerName != null and o.buyerName != """>
|
|
|
+ <bind name="n" value="'%' + o.buyerName + '%'" />
|
|
|
and u.nickname like #{n,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
|
|
|
- <bind name="a" value="o.startTime + ' 00:00:00'"/>
|
|
|
- <bind name="b" value="o.endTime + ' 23:59:59'"/>
|
|
|
+ <if test="o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != """>
|
|
|
+ <bind name="a" value="o.startTime + ' 00:00:00'" />
|
|
|
+ <bind name="b" value="o.endTime + ' 23:59:59'" />
|
|
|
and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
)oo
|
|
|
@@ -896,24 +945,24 @@
|
|
|
and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="o.processStatus == 3">
|
|
|
- and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="o.processStatus == null or o.processStatus ==''">
|
|
|
- and process_status >= 2
|
|
|
+ and process_status >= 2
|
|
|
</if>
|
|
|
- <if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
+ <if test="o.orderNo != null and o.orderNo != """>
|
|
|
and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.financeId != null and o.financeId != ""'>
|
|
|
+ <if test="o.financeId != null and o.financeId != """>
|
|
|
and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.buyerName != null and o.buyerName != ""'>
|
|
|
- <bind name="n" value="'%' + o.buyerName + '%'"/>
|
|
|
+ <if test="o.buyerName != null and o.buyerName != """>
|
|
|
+ <bind name="n" value="'%' + o.buyerName + '%'" />
|
|
|
and u.nickname like #{n,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
|
|
|
- <bind name="a" value="o.startTime + ' 00:00:00'"/>
|
|
|
- <bind name="b" value="o.endTime + ' 23:59:59'"/>
|
|
|
+ <if test="o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != """>
|
|
|
+ <bind name="a" value="o.startTime + ' 00:00:00'" />
|
|
|
+ <bind name="b" value="o.endTime + ' 23:59:59'" />
|
|
|
and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
union
|
|
|
@@ -922,19 +971,19 @@
|
|
|
left join `user` u on o.buyer_id = u.id
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
where delete_sign = 0 and approval = 2 and finance_id is null and order_status = 2
|
|
|
- <if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
+ <if test="o.orderNo != null and o.orderNo != """>
|
|
|
and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.financeId != null and o.financeId != ""'>
|
|
|
+ <if test="o.financeId != null and o.financeId != """>
|
|
|
and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.buyerName != null and o.buyerName != ""'>
|
|
|
- <bind name="n" value="'%' + o.buyerName + '%'"/>
|
|
|
+ <if test="o.buyerName != null and o.buyerName != """>
|
|
|
+ <bind name="n" value="'%' + o.buyerName + '%'" />
|
|
|
and u.nickname like #{n,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
|
|
|
- <bind name="a" value="o.startTime + ' 00:00:00'"/>
|
|
|
- <bind name="b" value="o.endTime + ' 23:59:59'"/>
|
|
|
+ <if test="o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != """>
|
|
|
+ <bind name="a" value="o.startTime + ' 00:00:00'" />
|
|
|
+ <bind name="b" value="o.endTime + ' 23:59:59'" />
|
|
|
and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
)oo
|
|
|
@@ -1012,46 +1061,47 @@
|
|
|
</select>
|
|
|
<!-- 财务专员查看需要待收款的数据 -->
|
|
|
<select id="financeList" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
|
|
|
- select o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,
|
|
|
+ select o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,
|
|
|
o.process_status as processStatus,ifnull(b.amount,0) as actuallyTotalAmount, o.contract_no as contractNo,o.approval,
|
|
|
a.name as sellerName, o.salesman_id as sellerId, o.buyer_id as buyerId, o.liquidation_status as liquidationStatus ,
|
|
|
o.first_amount as signFirstPayment, o.total_amount as signTotalAmount,o.create_time as createTime,
|
|
|
- 0 as companyId, "湖南科德信息咨询有限公司" as companyName
|
|
|
+ 0 as companyId, "湖南科德信息咨询有限公司" as companyName,d.name as departmentName
|
|
|
from t_order_new o
|
|
|
+ left join department d on o.order_dep=d.id
|
|
|
left join `user` u on o.buyer_id = u.id
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
|
|
|
group by order_no ) b on b.order_no = o.order_no
|
|
|
where delete_sign = 0
|
|
|
- <if test='o.processStatus == 3'>
|
|
|
+ <if test="o.processStatus == 3">
|
|
|
and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- <if test='o.processStatus == 4'>
|
|
|
- and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ <if test="o.processStatus == 4">
|
|
|
+ and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
and process_status
|
|
|
and (approval = 0 or approval = 2)
|
|
|
and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
- <if test='o.orderStatus != null and o.orderStatus != ""'>
|
|
|
+ <if test="o.orderStatus != null and o.orderStatus != """>
|
|
|
and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- <if test='o.departmentId != null and o.departmentId != ""'>
|
|
|
- and a.department_id = #{o.departmentId,jdbcType=INTEGER}
|
|
|
+ <if test="o.departmentId != null and o.departmentId != """>
|
|
|
+ and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- <if test='o.liquidationStatus != null and o.liquidationStatus != ""'>
|
|
|
+ <if test="o.liquidationStatus != null and o.liquidationStatus != """>
|
|
|
and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
|
|
|
- <if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
+ <if test="o.orderNo != null and o.orderNo != """>
|
|
|
and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.buyerName != null and o.buyerName != ""'>
|
|
|
- <bind name="n" value="'%' + o.buyerName + '%'"/>
|
|
|
+ <if test="o.buyerName != null and o.buyerName != """>
|
|
|
+ <bind name="n" value="'%' + o.buyerName + '%'" />
|
|
|
and u.nickname like #{n,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
|
|
|
- <bind name="a" value="o.startTime + ' 00:00:00'"/>
|
|
|
- <bind name="b" value="o.endTime + ' 23:59:59'"/>
|
|
|
+ <if test="o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != """>
|
|
|
+ <bind name="a" value="o.startTime + ' 00:00:00'" />
|
|
|
+ <bind name="b" value="o.endTime + ' 23:59:59'" />
|
|
|
and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
order by o.liquidation_status, o.sign_time desc
|
|
|
@@ -1067,38 +1117,38 @@
|
|
|
left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
|
|
|
group by order_no ) b on b.order_no = o.order_no
|
|
|
where delete_sign = 0
|
|
|
- <if test='o.processStatus == 3'>
|
|
|
+ <if test="o.processStatus == 3">
|
|
|
and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- <if test='o.processStatus == 4'>
|
|
|
- and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ <if test="o.processStatus == 4">
|
|
|
+ and process_status >= #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
and (approval = 0 or approval = 2)
|
|
|
and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
- <if test='o.orderStatus != null and o.orderStatus != ""'>
|
|
|
+ <if test="o.orderStatus != null and o.orderStatus != """>
|
|
|
and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- <if test='o.departmentId != null and o.departmentId != ""'>
|
|
|
- and a.department_id = #{o.departmentId,jdbcType=INTEGER}
|
|
|
+ <if test="o.departmentId != null and o.departmentId != """>
|
|
|
+ and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- <if test='o.liquidationStatus != null and o.liquidationStatus != ""'>
|
|
|
+ <if test="o.liquidationStatus != null and o.liquidationStatus != """>
|
|
|
and o.liquidation_status = #{o.liquidationStatus,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
+ <if test="o.orderNo != null and o.orderNo != """>
|
|
|
and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.buyerName != null and o.buyerName != ""'>
|
|
|
- <bind name="n" value="'%' + o.buyerName + '%'"/>
|
|
|
+ <if test="o.buyerName != null and o.buyerName != """>
|
|
|
+ <bind name="n" value="'%' + o.buyerName + '%'" />
|
|
|
and u.nickname like #{n,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
|
|
|
- <bind name="a" value="o.startTime + ' 00:00:00'"/>
|
|
|
- <bind name="b" value="o.endTime + ' 23:59:59'"/>
|
|
|
+ <if test="o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != """>
|
|
|
+ <bind name="a" value="o.startTime + ' 00:00:00'" />
|
|
|
+ <bind name="b" value="o.endTime + ' 23:59:59'" />
|
|
|
and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</select>
|
|
|
<!-- 通过订单编号获得订单的负责人(营销员) -->
|
|
|
- <select id="getSaleIdByOno" resultType="com.goafanti.order.bo.TOrderNewBo" parameterType="java.lang.String">
|
|
|
+ <select id="getSaleIdByOno" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
|
|
|
select salesman_id as salesmanId, a.name as salesmanName, a.email ,u.nickname as userName
|
|
|
from t_order_new o
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
@@ -1118,7 +1168,7 @@
|
|
|
</if>
|
|
|
from t_order_new a left join `user` b on a.buyer_id=b.id
|
|
|
left join admin c on a.salesman_id=c.id
|
|
|
- left join department dep on c.department_id=dep.id
|
|
|
+ left join department dep on a.order_dep=dep.id
|
|
|
left join admin d on a.finance_id=d.id
|
|
|
<if test="specially == 2">
|
|
|
left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
|
|
|
@@ -1138,7 +1188,7 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
and a.process_status =1 and a.order_status=1
|
|
|
<!-- and c.department_id in (#{deps,jdbcType=VARCHAR}) -->
|
|
|
and c.department_id in
|
|
|
- <foreach collection="deps" item="deps" open="(" separator="," close=")">
|
|
|
+ <foreach close=")" collection="deps" item="deps" open="(" separator=",">
|
|
|
#{deps.id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
@@ -1156,7 +1206,7 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
</if>
|
|
|
<if test="specially == 5">
|
|
|
and c.department_id in
|
|
|
- <foreach collection="deps" item="deps" open="(" separator="," close=")">
|
|
|
+ <foreach close=")" collection="deps" item="deps" open="(" separator=",">
|
|
|
#{deps.id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
@@ -1202,6 +1252,7 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
count(*)
|
|
|
from t_order_new a left join `user` b on a.buyer_id=b.id
|
|
|
left join admin c on a.salesman_id=c.id
|
|
|
+ left join department dep on a.order_dep=dep.id
|
|
|
left join admin d on a.finance_id=d.id
|
|
|
<if test="specially == 2">
|
|
|
left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
|
|
|
@@ -1220,7 +1271,7 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
<if test="specially == 1">
|
|
|
and a.process_status =1 and a.order_status=1
|
|
|
and c.department_id in
|
|
|
- <foreach collection="deps" item="deps" open="(" separator="," close=")">
|
|
|
+ <foreach close=")" collection="deps" item="deps" open="(" separator=",">
|
|
|
#{deps.id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
@@ -1238,7 +1289,7 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
</if>
|
|
|
<if test="specially == 5">
|
|
|
and c.department_id in
|
|
|
- <foreach collection="deps" item="deps" open="(" separator="," close=")">
|
|
|
+ <foreach close=")" collection="deps" item="deps" open="(" separator=",">
|
|
|
#{deps.id}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
@@ -1257,6 +1308,9 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
<if test="orderNo != null">
|
|
|
and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+ <if test="depId != null">
|
|
|
+ and dep.id = #{depId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
<if test="starTime !=null and endTime !=null">
|
|
|
and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1326,18 +1380,18 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
</select>
|
|
|
|
|
|
<select id="getOrderNewDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
|
|
|
- select
|
|
|
+ select
|
|
|
a.order_no as orderNo, a.order_type as orderType, a.creater, a.create_time as createTime,a.update_time as updateTime, a.buyer_id as buyerId, a.first_amount as firstAmount,
|
|
|
a.total_amount as totalAmount, a.settlement_amount as settlementAmount, order_status as orderStatus, a.liquidation_status as liquidationStatus, a.process_status as processStatus,
|
|
|
a.project_status as projectStatus, a.approval, a.order_remarks as orderRemarks, a.delete_sign as deleteSign, a.salesman_id as salesmanId, finance_id as financeId, technician_id as technicianId,
|
|
|
a.sign_time as signTime, a.settlement_time as settlementTime, a.contract_no as contractNo, a.contract_type as contractType, a.contacts, a.contact_mobile as contactMobile,
|
|
|
a.legal_person as legalPerson, a.legal_person_tel as legalPersonTel, a.proof_count as proofCount, a.proof_aid as proofAid,contract_picture_url as contractPictureUrl,
|
|
|
c.name as salesmanName,dep.name as depName,d.name as financeName,c.contact_mobile as salesmanMobile,d.contact_mobile as financeMobile,b.nickname as userName
|
|
|
- ,e.back_status as backStatus,f.name as initiateName,e.reason,date_format(e.create_time,'%Y-%m-%d') as backDate,a.buyer_id as uid
|
|
|
+ ,e.back_status as backStatus,f.name as initiateName,e.reason,date_format(e.create_time,'%Y-%m-%d') as backDate,a.buyer_id as uid,a.order_dep as orderDep
|
|
|
from t_order_new a
|
|
|
left join `user` b on a.buyer_id=b.id
|
|
|
left join admin c on a.salesman_id=c.id
|
|
|
- left join department dep on c.department_id=dep.id
|
|
|
+ left join department dep on a.order_dep=dep.id
|
|
|
left join admin d on a.finance_id=d.id
|
|
|
left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
|
|
|
left join admin f on e.initiate=f.id
|
|
|
@@ -1413,4 +1467,4 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
where order_no= #{orderNo,jdbcType=VARCHAR}
|
|
|
and finance_id= #{aid,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
-</mapper>
|
|
|
+</mapper>
|