|
|
@@ -21,12 +21,14 @@
|
|
|
<result column="province_name" jdbcType="VARCHAR" property="provinceName" />
|
|
|
<result column="legal_affairs" jdbcType="INTEGER" property="legalAffairs" />
|
|
|
<result column="dun_start_time" jdbcType="TIMESTAMP" property="dunStartTime" />
|
|
|
+ <result column="legal_affairs_type" jdbcType="INTEGER" property="legalAffairsType" />
|
|
|
+ <result column="operation_time" jdbcType="DATE" property="operationTime" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
id, order_no, salesman_id, finance_id, salesman_name, finance_name, final_receivables,
|
|
|
final_Receivables_time, invoice_amount, create_time, buyer_name, order_receivables,
|
|
|
order_arrears, payment_amount, cost_amount, dep_name, province_name, legal_affairs,
|
|
|
- dun_start_time
|
|
|
+ dun_start_time, legal_affairs_type, operation_time
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -45,14 +47,16 @@
|
|
|
create_time, buyer_name, order_receivables,
|
|
|
order_arrears, payment_amount, cost_amount,
|
|
|
dep_name, province_name, legal_affairs,
|
|
|
- dun_start_time)
|
|
|
+ dun_start_time, legal_affairs_type, operation_time
|
|
|
+ )
|
|
|
values (#{orderNo,jdbcType=VARCHAR}, #{salesmanId,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR},
|
|
|
#{salesmanName,jdbcType=VARCHAR}, #{financeName,jdbcType=VARCHAR}, #{finalReceivables,jdbcType=DECIMAL},
|
|
|
#{finalReceivablesTime,jdbcType=TIMESTAMP}, #{invoiceAmount,jdbcType=DECIMAL},
|
|
|
#{createTime,jdbcType=TIMESTAMP}, #{buyerName,jdbcType=VARCHAR}, #{orderReceivables,jdbcType=DECIMAL},
|
|
|
#{orderArrears,jdbcType=DECIMAL}, #{paymentAmount,jdbcType=DECIMAL}, #{costAmount,jdbcType=DECIMAL},
|
|
|
#{depName,jdbcType=VARCHAR}, #{provinceName,jdbcType=VARCHAR}, #{legalAffairs,jdbcType=INTEGER},
|
|
|
- #{dunStartTime,jdbcType=TIMESTAMP})
|
|
|
+ #{dunStartTime,jdbcType=TIMESTAMP}, #{legalAffairsType,jdbcType=INTEGER}, #{operationTime,jdbcType=DATE}
|
|
|
+ )
|
|
|
</insert>
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderMid" useGeneratedKeys="true">
|
|
|
insert into t_order_mid
|
|
|
@@ -111,6 +115,12 @@
|
|
|
<if test="dunStartTime != null">
|
|
|
dun_start_time,
|
|
|
</if>
|
|
|
+ <if test="legalAffairsType != null">
|
|
|
+ legal_affairs_type,
|
|
|
+ </if>
|
|
|
+ <if test="operationTime != null">
|
|
|
+ operation_time,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="orderNo != null">
|
|
|
@@ -167,6 +177,12 @@
|
|
|
<if test="dunStartTime != null">
|
|
|
#{dunStartTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
+ <if test="legalAffairsType != null">
|
|
|
+ #{legalAffairsType,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="operationTime != null">
|
|
|
+ #{operationTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderMid">
|
|
|
@@ -226,6 +242,12 @@
|
|
|
<if test="dunStartTime != null">
|
|
|
dun_start_time = #{dunStartTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
+ <if test="legalAffairsType != null">
|
|
|
+ legal_affairs_type = #{legalAffairsType,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="operationTime != null">
|
|
|
+ operation_time = #{operationTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
@@ -248,7 +270,9 @@
|
|
|
dep_name = #{depName,jdbcType=VARCHAR},
|
|
|
province_name = #{provinceName,jdbcType=VARCHAR},
|
|
|
legal_affairs = #{legalAffairs,jdbcType=INTEGER},
|
|
|
- dun_start_time = #{dunStartTime,jdbcType=TIMESTAMP}
|
|
|
+ dun_start_time = #{dunStartTime,jdbcType=TIMESTAMP},
|
|
|
+ legal_affairs_type = #{legalAffairsType,jdbcType=INTEGER},
|
|
|
+ operation_time = #{operationTime,jdbcType=DATE}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
<select id="selectByOrderNo" resultMap="BaseResultMap">
|
|
|
@@ -309,7 +333,6 @@
|
|
|
<update id="updateByOrderNo">
|
|
|
update t_order_mid
|
|
|
<set>
|
|
|
-
|
|
|
<if test="salesmanId != null">
|
|
|
salesman_id = #{salesmanId,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
@@ -358,6 +381,15 @@
|
|
|
<if test="legalAffairs != null">
|
|
|
legal_affairs = #{legalAffairs,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="dunStartTime != null">
|
|
|
+ dun_start_time = #{dunStartTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="legalAffairsType != null">
|
|
|
+ legal_affairs_type = #{legalAffairsType,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="operationTime != null">
|
|
|
+ operation_time = #{operationTime,jdbcType=DATE},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
@@ -367,17 +399,28 @@
|
|
|
a.total_amount totalAmount ,a.settlement_amount settlementAmount ,b.order_receivables orderReceivables,b.legal_affairs legalAffairs,
|
|
|
b.order_arrears orderArrears,b.dun_start_time dunStartTime,date_format(b.dun_start_time,'%Y-%m-%d %H:%i:%S')dunStartTimes
|
|
|
<if test="type==1 or type==2 or type==3">
|
|
|
- ,c.operation_time operationTime,c.`type`
|
|
|
+ ,b.operation_time operationTime,b.`type`
|
|
|
</if>
|
|
|
from t_order_new a left join t_order_mid b on a.order_no =b.order_no
|
|
|
+ <if test="shiro == 2">
|
|
|
+ left join admin c on a.salesman_id =c.id
|
|
|
+ </if>
|
|
|
<if test="type==1 or type==2 or type==3">
|
|
|
- left join t_order_legal_affairs c on c.order_no =b.order_no
|
|
|
where b.legal_affairs =1
|
|
|
</if>
|
|
|
<if test="type==0">
|
|
|
where b.order_receivables >0
|
|
|
</if>
|
|
|
- <if test="userName != null">
|
|
|
+ <if test="shiro==1">
|
|
|
+ and a.order_type in
|
|
|
+ <foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
|
+ #{dep}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="shiro ==2">
|
|
|
+ and c.superior_id = #{sid}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null">
|
|
|
and b.buyer_name like concat('%',#{userName},'%')
|
|
|
</if>
|
|
|
<if test="legalAffairs != null">
|
|
|
@@ -399,10 +442,10 @@
|
|
|
</if>
|
|
|
<if test="type==1 or type==2 or type==3">
|
|
|
<if test="startTime != null and endTime != null">
|
|
|
- and c.operation_time between #{startTime} and #{endTime}
|
|
|
+ and b.operation_time between #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
</if>
|
|
|
- order by b.dun_start_time desc
|
|
|
+ order by b.dun_start_time
|
|
|
<if test="page_sql != null">
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
@@ -410,13 +453,24 @@
|
|
|
<select id="legalAffairsOrderCount" resultType="integer">
|
|
|
select count(*)
|
|
|
from t_order_new a left join t_order_mid b on a.order_no =b.order_no
|
|
|
+ <if test="shiro == 2">
|
|
|
+ left join admin c on a.salesman_id =c.id
|
|
|
+ </if>
|
|
|
<if test="type==1 or type==2 or type==3">
|
|
|
- left join t_order_legal_affairs c on c.order_no =b.order_no
|
|
|
where b.legal_affairs =1
|
|
|
</if>
|
|
|
<if test="type==0">
|
|
|
where b.order_receivables >0
|
|
|
</if>
|
|
|
+ <if test="shiro==1">
|
|
|
+ and a.order_type in
|
|
|
+ <foreach close=")" collection="deps" item="dep" open="(" separator=",">
|
|
|
+ #{dep}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="shiro ==2">
|
|
|
+ and c.superior_id = #{sid}
|
|
|
+ </if>
|
|
|
<if test="userName != null">
|
|
|
and b.buyer_name like concat('%',#{userName},'%')
|
|
|
</if>
|
|
|
@@ -439,7 +493,7 @@
|
|
|
</if>
|
|
|
<if test="type==1 or type==2 or type==3">
|
|
|
<if test="startTime != null and endTime != null">
|
|
|
- and c.operation_time between #{startTime} and #{endTime}
|
|
|
+ and b.operation_time between #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
</if>
|
|
|
</select>
|