ソースを参照

部门流水效率优化

anderx 3 年 前
コミット
13bece5d47
共有2 個のファイルを変更した61 個の追加62 個の削除を含む
  1. 56 57
      src/main/java/com/goafanti/common/mapper/TOrderBillNewMapper.xml
  2. 5 5
      src/main/resources/props/config_local.properties

+ 56 - 57
src/main/java/com/goafanti/common/mapper/TOrderBillNewMapper.xml

@@ -100,8 +100,8 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Wed Feb 19 08:54:03 CST 2020.
       This element was generated on Wed Feb 19 08:54:03 CST 2020.
     -->
     -->
-    bill_no, order_no, creater, create_time, update_time, payee_id, payer_id, transaction_amount, 
-    transaction_subject, transaction_channel, remarks, confirm_sign, delete_sign, financial_pay_no, 
+    bill_no, order_no, creater, create_time, update_time, payee_id, payer_id, transaction_amount,
+    transaction_subject, transaction_channel, remarks, confirm_sign, delete_sign, financial_pay_no,
     financial_pay_time, type, delete_time, refund_time
     financial_pay_time, type, delete_time, refund_time
   </sql>
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderBillNewExample" resultMap="BaseResultMap">
   <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderBillNewExample" resultMap="BaseResultMap">
@@ -129,7 +129,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Wed Feb 19 08:54:03 CST 2020.
       This element was generated on Wed Feb 19 08:54:03 CST 2020.
     -->
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     from t_order_bill_new
     from t_order_bill_new
     where bill_no = #{billNo,jdbcType=VARCHAR}
     where bill_no = #{billNo,jdbcType=VARCHAR}
@@ -160,18 +160,18 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Wed Feb 19 08:54:03 CST 2020.
       This element was generated on Wed Feb 19 08:54:03 CST 2020.
     -->
     -->
-    insert into t_order_bill_new (bill_no, order_no, creater, 
-      create_time, update_time, payee_id, 
-      payer_id, transaction_amount, transaction_subject, 
-      transaction_channel, remarks, confirm_sign, 
-      delete_sign, financial_pay_no, financial_pay_time, 
+    insert into t_order_bill_new (bill_no, order_no, creater,
+      create_time, update_time, payee_id,
+      payer_id, transaction_amount, transaction_subject,
+      transaction_channel, remarks, confirm_sign,
+      delete_sign, financial_pay_no, financial_pay_time,
       type, delete_time, refund_time
       type, delete_time, refund_time
       )
       )
-    values (#{billNo,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, #{creater,jdbcType=VARCHAR}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{payeeId,jdbcType=VARCHAR}, 
-      #{payerId,jdbcType=VARCHAR}, #{transactionAmount,jdbcType=DECIMAL}, #{transactionSubject,jdbcType=INTEGER}, 
-      #{transactionChannel,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, #{confirmSign,jdbcType=INTEGER}, 
-      #{deleteSign,jdbcType=TINYINT}, #{financialPayNo,jdbcType=VARCHAR}, #{financialPayTime,jdbcType=TIMESTAMP}, 
+    values (#{billNo,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, #{creater,jdbcType=VARCHAR},
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{payeeId,jdbcType=VARCHAR},
+      #{payerId,jdbcType=VARCHAR}, #{transactionAmount,jdbcType=DECIMAL}, #{transactionSubject,jdbcType=INTEGER},
+      #{transactionChannel,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, #{confirmSign,jdbcType=INTEGER},
+      #{deleteSign,jdbcType=TINYINT}, #{financialPayNo,jdbcType=VARCHAR}, #{financialPayTime,jdbcType=TIMESTAMP},
       #{type,jdbcType=INTEGER}, #{deleteTime,jdbcType=TIMESTAMP}, #{refundTime,jdbcType=TIMESTAMP}
       #{type,jdbcType=INTEGER}, #{deleteTime,jdbcType=TIMESTAMP}, #{refundTime,jdbcType=TIMESTAMP}
       )
       )
   </insert>
   </insert>
@@ -497,26 +497,26 @@
   </select>
   </select>
   <!-- 根据流水编号获得流水详情 -->
   <!-- 根据流水编号获得流水详情 -->
   <select id="getOneRefundFlow" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderBillNew">
   <select id="getOneRefundFlow" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderBillNew">
-  	select 
-  	b.bill_no as billNo, b.order_no as orderNo, b.creater, b.create_time as createTime, b.update_time as updateTime, 
-  	b.payee_id as payeeId, b.payer_id as payerId, b.transaction_amount as transactionAmount, 
-    b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel,  
-    b.remarks, b.confirm_sign confirmSign, b.delete_sign deleteSign, b.financial_pay_no as financialPayNo, 
+  	select
+  	b.bill_no as billNo, b.order_no as orderNo, b.creater, b.create_time as createTime, b.update_time as updateTime,
+  	b.payee_id as payeeId, b.payer_id as payerId, b.transaction_amount as transactionAmount,
+    b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel,
+    b.remarks, b.confirm_sign confirmSign, b.delete_sign deleteSign, b.financial_pay_no as financialPayNo,
     b.financial_pay_time as financialPayTimes, u.nickname as payerName, a.nickname as payeeName
     b.financial_pay_time as financialPayTimes, u.nickname as payerName, a.nickname as payeeName
-     from t_order_bill_new b 
+     from t_order_bill_new b
   	left join `user` u on b.payer_id = u.id
   	left join `user` u on b.payer_id = u.id
   	left join `user` a on b.payee_id = a.id
   	left join `user` a on b.payee_id = a.id
   	where b.delete_sign = 0 and bill_no = #{_parameter,jdbcType=VARCHAR}
   	where b.delete_sign = 0 and bill_no = #{_parameter,jdbcType=VARCHAR}
   </select>
   </select>
   <!-- 根据订单编号查看该订单相关的所有流水 -->
   <!-- 根据订单编号查看该订单相关的所有流水 -->
   <select id="getOneOrderAllRefundFlow" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderBillNew">
   <select id="getOneOrderAllRefundFlow" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderBillNew">
-  	select 
-  	b.bill_no as billNo, b.order_no as orderNo, b.creater, b.create_time as createTime, b.update_time as updateTime, 
-  	b.payee_id as payeeId, b.payer_id as payerId, b.transaction_amount as transactionAmount, 
-    b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel,  
-    b.remarks, b.confirm_sign confirmSign, b.delete_sign deleteSign, b.financial_pay_no as financialPayNo, 
+  	select
+  	b.bill_no as billNo, b.order_no as orderNo, b.creater, b.create_time as createTime, b.update_time as updateTime,
+  	b.payee_id as payeeId, b.payer_id as payerId, b.transaction_amount as transactionAmount,
+    b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel,
+    b.remarks, b.confirm_sign confirmSign, b.delete_sign deleteSign, b.financial_pay_no as financialPayNo,
     b.financial_pay_time as financialPayTimes, u.nickname as payerName, a.nickname as payeeName
     b.financial_pay_time as financialPayTimes, u.nickname as payerName, a.nickname as payeeName
-     from t_order_bill_new b 
+     from t_order_bill_new b
   	left join `user` u on b.payer_id = u.id
   	left join `user` u on b.payer_id = u.id
   	left join `user` a on b.payee_id = a.id
   	left join `user` a on b.payee_id = a.id
   	where b.delete_sign = 0 and order_no = #{_parameter,jdbcType=VARCHAR}
   	where b.delete_sign = 0 and order_no = #{_parameter,jdbcType=VARCHAR}
@@ -529,16 +529,16 @@
 		b.transaction_channel as transactionChannel, b.delete_sign deleteSign, date_format(b.financial_pay_time, '%Y-%m-%d') as financialPayTimes,
 		b.transaction_channel as transactionChannel, b.delete_sign deleteSign, date_format(b.financial_pay_time, '%Y-%m-%d') as financialPayTimes,
 		b.financial_pay_no as financialPayNo, date_format(b.refund_time, '%Y-%m-%d') refundTimes, b.creater, ad.name as createrName,
 		b.financial_pay_no as financialPayNo, date_format(b.refund_time, '%Y-%m-%d') refundTimes, b.creater, ad.name as createrName,
 		tm.salesman_name saleName, b.type, date_format(b.delete_time, '%Y-%m-%d %H:%I:%S') as deleteTimes
 		tm.salesman_name saleName, b.type, date_format(b.delete_time, '%Y-%m-%d %H:%I:%S') as deleteTimes
-		from t_order_bill_new b 
-		left join `user` u on b.payer_id = u.id 
-		left join `user` a on b.payee_id = a.id 
+		from t_order_bill_new b FORCE index(t_order_bill_new_create_time_IDX)
+		left join `user` u on b.payer_id = u.id
+		left join `user` a on b.payee_id = a.id
 		left join admin ad on b.creater = ad.id
 		left join admin ad on b.creater = ad.id
 		left join t_order_new o on o.order_no = b.order_no
 		left join t_order_new o on o.order_no = b.order_no
 		left join t_order_mid tm on tm.order_no=b.order_no
 		left join t_order_mid tm on tm.order_no=b.order_no
 		left join department d on o.order_dep = d.id
 		left join department d on o.order_dep = d.id
-	  	where 1=1 
+	  	where 1=1
 	  	<if test="fids != null and fids.size() &gt; 0">
 	  	<if test="fids != null and fids.size() &gt; 0">
-	  	and d.finance_id in 
+	  	and d.finance_id in
 	   <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
 	   <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
        		#{item}
        		#{item}
      	</foreach>
      	</foreach>
@@ -572,16 +572,15 @@
   </select>
   </select>
   <select id="myBillCount" parameterType="Map" resultType="java.lang.Integer">
   <select id="myBillCount" parameterType="Map" resultType="java.lang.Integer">
   	select count(*)
   	select count(*)
-  	from t_order_bill_new b 
-		left join `user` u on b.payer_id = u.id 
-		left join `user` a on b.payee_id = a.id 
-		left join admin ad on b.creater = ad.id
+  	from t_order_bill_new b
+		left join `user` u on b.payer_id = u.id
+		left join `user` a on b.payee_id = a.id
 		left join t_order_new o on o.order_no = b.order_no
 		left join t_order_new o on o.order_no = b.order_no
 		left join t_order_mid tm on tm.order_no=b.order_no
 		left join t_order_mid tm on tm.order_no=b.order_no
 	  	left join department d on o.order_dep = d.id
 	  	left join department d on o.order_dep = d.id
-	  	where 1=1 
+	  	where 1=1
 	  	<if test="fids != null and fids.size() &gt; 0">
 	  	<if test="fids != null and fids.size() &gt; 0">
-	  	and d.finance_id in 
+	  	and d.finance_id in
 	   <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
 	   <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
        		#{item}
        		#{item}
      	</foreach>
      	</foreach>
@@ -617,10 +616,10 @@
 	  	left join `user` u on b.payer_id = u.id
 	  	left join `user` u on b.payer_id = u.id
 	  	left join `user` a on b.payee_id = a.id
 	  	left join `user` a on b.payee_id = a.id
 	  	left join t_order_new o on o.order_no = b.order_no
 	  	left join t_order_new o on o.order_no = b.order_no
-	  	left join admin oa on oa.id = o.salesman_id 
+	  	left join admin oa on oa.id = o.salesman_id
 	  	left join department d on oa.department_id = d.id
 	  	left join department d on oa.department_id = d.id
-	  	where 
-	  	b.delete_sign = 0 
+	  	where
+	  	b.delete_sign = 0
 	  	<if test="payerName != null and payerName != &quot;&quot;">
 	  	<if test="payerName != null and payerName != &quot;&quot;">
 	  	<bind name="nn" value="'%' + payerName + '%'" />
 	  	<bind name="nn" value="'%' + payerName + '%'" />
 	  	and u.nickname like #{nn,jdbcType=VARCHAR}
 	  	and u.nickname like #{nn,jdbcType=VARCHAR}
@@ -637,10 +636,10 @@
   </select>
   </select>
   <!-- 获得流水记录 -->
   <!-- 获得流水记录 -->
   <select id="getBillData" parameterType="com.goafanti.common.model.TOrderBillNew" resultType="com.goafanti.common.model.TOrderBillNew">
   <select id="getBillData" parameterType="com.goafanti.common.model.TOrderBillNew" resultType="com.goafanti.common.model.TOrderBillNew">
-  select 
+  select
   	b.bill_no as billNo, b.order_no as orderNo, b.transaction_amount as transactionAmount,
   	b.bill_no as billNo, b.order_no as orderNo, b.transaction_amount as transactionAmount,
-  	u.nickname as payerName, a.nickname as payeeName, 
-  	b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel, 
+  	u.nickname as payerName, a.nickname as payeeName,
+  	b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel,
   	b.financial_pay_time as financialPayTimes,b.financial_pay_no as financialPayNo,
   	b.financial_pay_time as financialPayTimes,b.financial_pay_no as financialPayNo,
   	b.creater, ad.name as createrName, oa.name as saleName, b.create_time as createTime
   	b.creater, ad.name as createrName, oa.name as saleName, b.create_time as createTime
   	from t_order_bill_new b
   	from t_order_bill_new b
@@ -649,7 +648,7 @@
   	left join admin ad on b.creater = ad.id
   	left join admin ad on b.creater = ad.id
   	left join t_order_new o on o.order_no = b.order_no
   	left join t_order_new o on o.order_no = b.order_no
   	left join admin oa on oa.id = o.salesman_id
   	left join admin oa on oa.id = o.salesman_id
-  	where b.delete_sign = 0 
+  	where b.delete_sign = 0
   	<if test="payerName != null and payerName != &quot;&quot;">
   	<if test="payerName != null and payerName != &quot;&quot;">
   	<bind name="nn" value="'%' + payerName + '%'" />
   	<bind name="nn" value="'%' + payerName + '%'" />
   	and u.nickname like #{nn,jdbcType=VARCHAR}
   	and u.nickname like #{nn,jdbcType=VARCHAR}
@@ -673,24 +672,24 @@
 where  a.order_no= #{orderNo,jdbcType=VARCHAR};
 where  a.order_no= #{orderNo,jdbcType=VARCHAR};
  </select>
  </select>
  <select id="selectByOrderNo" resultType="com.goafanti.order.bo.BillBo">
  <select id="selectByOrderNo" resultType="com.goafanti.order.bo.BillBo">
- select date_format(a.financial_pay_time,'%Y-%m-%d') payTime,a.transaction_amount transactionAmount,b.name aName from t_order_bill_new a 
+ select date_format(a.financial_pay_time,'%Y-%m-%d') payTime,a.transaction_amount transactionAmount,b.name aName from t_order_bill_new a
 left join admin b on a.creater=b.id
 left join admin b on a.creater=b.id
-where order_no= #{orderNo,jdbcType=VARCHAR};	
+where order_no= #{orderNo,jdbcType=VARCHAR};
  </select>
  </select>
  <insert id="insertBatch" parameterType="com.goafanti.common.model.TOrderBillNew">
  <insert id="insertBatch" parameterType="com.goafanti.common.model.TOrderBillNew">
-    insert into t_order_bill_new (bill_no, order_no, creater, 
-      create_time, update_time, payee_id, 
-      payer_id, transaction_amount, transaction_subject, 
-      transaction_channel, remarks, confirm_sign, 
-      delete_sign, financial_pay_no, financial_pay_time, 
-      type)values 
+    insert into t_order_bill_new (bill_no, order_no, creater,
+      create_time, update_time, payee_id,
+      payer_id, transaction_amount, transaction_subject,
+      transaction_channel, remarks, confirm_sign,
+      delete_sign, financial_pay_no, financial_pay_time,
+      type)values
        <foreach collection="list" index="index" item="item" separator=",">
        <foreach collection="list" index="index" item="item" separator=",">
-      	(#{item.billNo,jdbcType=VARCHAR}, #{item.orderNo,jdbcType=VARCHAR}, #{item.creater,jdbcType=VARCHAR}, 
-      #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.payeeId,jdbcType=VARCHAR}, 
-      #{item.payerId,jdbcType=VARCHAR}, #{item.transactionAmount,jdbcType=DECIMAL}, #{item.transactionSubject,jdbcType=INTEGER}, 
-      #{item.transactionChannel,jdbcType=INTEGER}, #{item.remarks,jdbcType=VARCHAR}, #{item.confirmSign,jdbcType=INTEGER}, 
-      #{item.deleteSign,jdbcType=TINYINT}, #{item.financialPayNo,jdbcType=VARCHAR}, #{item.financialPayTime,jdbcType=TIMESTAMP}, 
+      	(#{item.billNo,jdbcType=VARCHAR}, #{item.orderNo,jdbcType=VARCHAR}, #{item.creater,jdbcType=VARCHAR},
+      #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.payeeId,jdbcType=VARCHAR},
+      #{item.payerId,jdbcType=VARCHAR}, #{item.transactionAmount,jdbcType=DECIMAL}, #{item.transactionSubject,jdbcType=INTEGER},
+      #{item.transactionChannel,jdbcType=INTEGER}, #{item.remarks,jdbcType=VARCHAR}, #{item.confirmSign,jdbcType=INTEGER},
+      #{item.deleteSign,jdbcType=TINYINT}, #{item.financialPayNo,jdbcType=VARCHAR}, #{item.financialPayTime,jdbcType=TIMESTAMP},
       #{item.type,jdbcType=INTEGER})
       #{item.type,jdbcType=INTEGER})
     </foreach>
     </foreach>
   </insert>
   </insert>
-</mapper>
+</mapper>

+ 5 - 5
src/main/resources/props/config_local.properties

@@ -1,11 +1,11 @@
 dev.name=local
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
-#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=123456
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft20220225?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
 jdbc.username=root
-jdbc.password=aftdev
+jdbc.password=123456
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.initialSize=3
 jdbc.maxActive=20
 jdbc.maxActive=20