From 72832ec2720d2bd5970be5afc612551dd78e13d3 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期二, 28 一月 2020 11:41:14 +0800
Subject: [PATCH] 优化sql 错误
---
java110-db/src/main/resources/mapper/hardwareAdapation/CarInoutServiceDaoImplMapper.xml | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/java110-db/src/main/resources/mapper/hardwareAdapation/CarInoutServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/hardwareAdapation/CarInoutServiceDaoImplMapper.xml
index 6e8a0fa..ad65ceb 100644
--- a/java110-db/src/main/resources/mapper/hardwareAdapation/CarInoutServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/hardwareAdapation/CarInoutServiceDaoImplMapper.xml
@@ -84,9 +84,12 @@
<select id="getCarInoutInfo" parameterType="Map" resultType="Map">
select t.in_time,t.in_time inTime,t.inout_id,t.inout_id inoutId,t.car_num,t.car_num
carNum,t.status_cd,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id
- bId,t.out_time,t.out_time outTime
- from car_inout t
+ bId,t.out_time,t.out_time outTime,td1.name stateName
+ from car_inout t,t_dict td1
where 1 =1
+ and t.state = td1.status_cd
+ and td1.table_name = 'car_inout'
+ and td1.table_columns = 'state'
<if test="inTime !=null ">
and t.in_time= #{inTime}
</if>
@@ -117,6 +120,7 @@
<if test="outTime !=null ">
and t.out_time= #{outTime}
</if>
+ order by t.create_time desc
<if test="page != -1 and page != null ">
limit #{page}, #{row}
</if>
@@ -158,8 +162,11 @@
<!-- 鏌ヨ杩涘嚭鍦烘暟閲� add by wuxw 2018-07-03 -->
<select id="queryCarInoutsCount" parameterType="Map" resultType="Map">
select count(1) count
- from car_inout t
+ from car_inout t,t_dict td1
where 1 =1
+ and t.state = td1.status_cd
+ and td1.table_name = 'car_inout'
+ and td1.table_columns = 'state'
<if test="inTime !=null ">
and t.in_time= #{inTime}
</if>
--
Gitblit v1.8.0