<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.boying.mapper.OutParkMapper">
|
|
<resultMap id="outParkMap" type="com.boying.entity.OutPark">
|
<id property="id" column="id"/>
|
<result property="createTime" column="create_time"/>
|
<result property="delFlag" column="del_flag"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="barrierId" column="barrier_id"/>
|
<result property="carNo" column="car_no"/>
|
<result property="code" column="code"/>
|
<result property="enterTime" column="enter_time"/>
|
<result property="parkId" column="park_id"/>
|
<result property="payCode" column="pay_code"/>
|
<result property="price" column="price"/>
|
<result property="remark" column="remark"/>
|
<result property="status" column="status"/>
|
<result property="status2" column="status2"/>
|
<result property="status3" column="status3"/>
|
<result property="time" column="time"/>
|
<result property="code2" column="code2"/>
|
<result property="txnOrderId" column="txn_order_id"/>
|
<result property="txnOrderTime" column="txn_order_time"/>
|
<result property="respTxnTime" column="resp_txn_time"/>
|
<result property="qrCode" column="qr_code"/>
|
</resultMap>
|
<select id="getList" resultType="com.boying.entity.OutPark">
|
select * from out_park
|
<where>
|
1=1
|
<if test="carNo != null and carNo != ''">
|
and car_no like concat('%',#{carNo},'%')
|
</if>
|
<if test="payCode != null and payCode != ''">
|
and pay_code = #{payCode}
|
</if>
|
<if test="parkId != null and parkId != ''">
|
and park_id = #{parkId}
|
</if>
|
<if test="date != null and date != ''">
|
and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{date},'%Y-%m-%d')
|
and DATE_FORMAT(create_time,'%Y-%m-%d') <= DATE_FORMAT(#{date},'%Y-%m-%d')
|
</if>
|
</where>
|
order by create_time desc limit #{current},#{size}
|
</select>
|
|
<select id="getCount" resultType="java.lang.Long">
|
select count(*) from out_park
|
<where>
|
1=1
|
<if test="carNo != null and carNo != ''">
|
and car_no = #{carNo}
|
</if>
|
<if test="payCode != null and payCode != ''">
|
and pay_code = #{payCode}
|
</if>
|
<if test="parkId != null and parkId != ''">
|
and park_id = #{parkId}
|
</if>
|
<if test="date != null and date != ''">
|
and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{date},'%Y-%m-%d')
|
and DATE_FORMAT(create_time,'%Y-%m-%d') <= DATE_FORMAT(#{date},'%Y-%m-%d')
|
</if>
|
</where>
|
</select>
|
<select id="getOneByBarrierId" resultType="com.boying.entity.OutPark">
|
select id,car_no,status2 from out_park
|
where barrier_id = #{barrierId} and `status` = 1 and status2 = 0 and del_flag = 0 limit 1;
|
</select>
|
|
<select id="getVoList" resultType="com.boying.entity.vo.OutParkVo">
|
SELECT SUM(price) price,IFNULL(count( id ),0) num,park_id,DATE_FORMAT(update_time, '%Y-%m-%d') ti FROM out_park
|
WHERE `status` = 1 AND pay_code IS NOT NULL
|
<if test="parkId != null and parkId != ''">
|
and park_id = #{parkId}
|
</if>
|
AND DATE_FORMAT(update_time,'%Y-%m-%d') >= DATE_FORMAT(#{startDate},'%Y-%m-%d')
|
AND DATE_FORMAT(update_time,'%Y-%m-%d') <= DATE_FORMAT(#{endDate},'%Y-%m-%d')
|
GROUP BY ti,park_id
|
</select>
|
</mapper>
|