|
@@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="id" column="id" />
|
|
|
<result property="parkId" column="park_id" />
|
|
|
<result property="allSpaceNumber" column="all_space_number" />
|
|
|
- <result property="useSpaceNumber" column="use_space_umber" />
|
|
|
+ <result property="useSpaceNumber" column="use_space_number" />
|
|
|
<result property="remainSpaceNumber" column="remain_space_number" />
|
|
|
<result property="inParkCount" column="in_park_count" />
|
|
|
<result property="outParkCount" column="out_park_count" />
|
|
@@ -22,28 +22,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectParkData" parameterType="ParkData" resultMap="BasicCruiseShipResult">
|
|
|
- SELECT
|
|
|
- id,
|
|
|
- park_id,
|
|
|
- all_space_number,
|
|
|
- use_space_umber,
|
|
|
- remain_space_number,
|
|
|
- in_park_count,
|
|
|
- out_park_count,
|
|
|
- total_out_money,
|
|
|
- total_pre_money,
|
|
|
- max( create_time ) create_time
|
|
|
- FROM
|
|
|
- parking_lot_statistics
|
|
|
- GROUP BY
|
|
|
- park_id
|
|
|
- ORDER BY
|
|
|
- create_time DESC;
|
|
|
+ SELECT pls.id,
|
|
|
+ pls.park_id,
|
|
|
+ pls.all_space_number,
|
|
|
+ pls.use_space_number,
|
|
|
+ pls.remain_space_number,
|
|
|
+ pls.in_park_count,
|
|
|
+ pls.out_park_count,
|
|
|
+ pls.total_out_money / 100 AS total_out_money,
|
|
|
+ pls.total_pre_money / 100 AS total_pre_money,
|
|
|
+ pls.create_time
|
|
|
+ FROM parking_lot_statistics pls
|
|
|
+ JOIN (SELECT park_id,
|
|
|
+ MAX(create_time) AS max_create_time
|
|
|
+ FROM parking_lot_statistics
|
|
|
+ GROUP BY park_id) max_create
|
|
|
+ ON pls.park_id = max_create.park_id AND pls.create_time = max_create.max_create_time
|
|
|
+ ORDER BY pls.create_time DESC;
|
|
|
</select>
|
|
|
|
|
|
<insert id="save" >
|
|
|
insert into parking_lot_statistics (
|
|
|
- park_id,all_space_number,use_space_umber,remain_space_number,in_park_count,out_park_count,total_out_money,total_pre_money,create_time)
|
|
|
+ park_id,all_space_number,use_space_number,remain_space_number,in_park_count,out_park_count,total_out_money,total_pre_money,create_time)
|
|
|
values(
|
|
|
#{parkId},#{allSpaceNumber},#{useSpaceNumber},#{remainSpaceNumber},#{inParkCount},#{outParkCount},#{totalOutMoney},#{totalPreMoney},now()
|
|
|
)
|