<?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.EnterParkMapper">
|
|
<resultMap id="enterParkMap" type="com.boying.entity.EnterPark">
|
<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="parkId" column="park_id"/>
|
<result property="status" column="status"/>
|
</resultMap>
|
<select id="getList" resultType="com.boying.entity.EnterPark">
|
select * from enter_park
|
<where>
|
1=1
|
<if test="carNo != null and carNo != ''">
|
and car_no like concat('%',#{carNo},'%')
|
</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 enter_park
|
<where>
|
1=1
|
<if test="carNo != null and carNo != ''">
|
and car_no = #{carNo}
|
</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>
|
</mapper>
|