123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- package com.sky.ioc.mapper;
- import com.baomidou.mybatisplus.core.mapper.BaseMapper;
- import com.sky.ioc.entity.domain.parking.Park;
- import com.sky.ioc.entity.params.IocParam;
- import com.sky.ioc.entity.params.IocTimeRange;
- import com.sky.ioc.entity.params.scene.ParkParam;
- import org.apache.ibatis.annotations.Mapper;
- import org.apache.ibatis.annotations.Param;
- import org.apache.ibatis.annotations.Select;
- import java.util.List;
- import java.util.Map;
- @Mapper
- public interface ParkMapper extends BaseMapper<Park> {
- @Select("<script>" +
- "SELECT count(1) FROM park where 1=1 " +
- "<if test='iocParam!=null and iocParam.companyId != null '>" +
- " and company_id=#{iocParam.companyId} " +
- "</if>"+
- "<if test='iocParam!=null and iocParam.timeRange != null '>" +
- "<![CDATA[ and entry_time > #{iocParam.timeRange.startDate} " +
- " and entry_time < #{iocParam.timeRange.endDate} ]]>" +
- "</if>"+
- "</script>")
- Integer getTotalParkByCompanyIdAndDeptId(@Param("iocParam") IocParam iocParam);
- @Select("<script>" +
- "SELECT count(1) FROM park where 1=1 " +
- "<if test='iocParam!=null and iocParam.companyId != null '>" +
- " and company_id=#{iocParam.companyId} " +
- "</if>"+
- "<if test='iocParam!=null and iocParam.timeRange != null '>" +
- " <![CDATA[ and entry_time > #{iocParam.timeRange.startDate} and entry_time < #{iocParam.timeRange.endDate} ]]> " +
- "</if>"+
- "</script>")
- Integer getTotalParkByCompanyIdAndDeptIdAndEntryTime(@Param("iocParam") IocParam iocParam);
- @Select("<script>" +
- "SELECT count(1) FROM park where 1=1 " +
- "<if test='iocParam!=null and iocParam.companyId != null '>" +
- " and company_id=#{iocParam.companyId} " +
- "</if>"+
- "<if test='iocParam!=null '>" +
- " <![CDATA[ and departure_time > #{iocParam.timeRange.startDate} and departure_time < #{iocParam.timeRange.endDate} ]]>" +
- "</if>"+
- "</script>")
- Integer getTotalParkByCompanyIdAndDeptIdAndDepartureTime(@Param("iocParam") IocParam iocParam);
- @Select("<script>" +
- "SELECT licence_plate,entry_time,departure_time from park" +
- " where 1=1 " +
- "<if test='parkParam!=null and parkParam.startTime!=null'>" +
- " and entry_time BETWEEN #{parkParam.startTime} AND #{parkParam.endTime}" +
- "</if>" +
- "<if test='parkParam!=null and parkParam.carCode!=\"\" and parkParam.carCode!=null'>" +
- " and licence_plate = #{parkParam.carCode} " +
- "</if>" +
- " ORDER BY id " +
- "limit #{parkParam.pageSize} OFFSET #{parkParam.pageStart}" +
- "</script>")
- List<Map<String,Object>> pageList(@Param("parkParam")ParkParam parkParam);
- @Select("<script>" +
- "SELECT count(*) from park" +
- " where 1=1 " +
- "<if test='parkParam!=null and parkParam.startTime!=null'>" +
- " and entry_time BETWEEN #{parkParam.startTime} AND #{parkParam.endTime}" +
- "</if>" +
- "<if test='parkParam!=null and parkParam.carCode!=\"\" and parkParam.carCode!=null'>" +
- " and licence_plate = #{parkParam.carCode} " +
- "</if>" +
- "</script>")
- Long pageCount(@Param("parkParam")ParkParam parkParam);
- @Select("<script>" +
- "SELECT parking_numbers,sum(hours) as hours FROM park where 1=1 " +
- "<if test='iocParam!=null and iocParam.companyId != null '>" +
- " and company_id=#{iocParam.companyId} " +
- "</if>"+
- "<if test='iocParam!=null '>" +
- " <![CDATA[ and departure_time > #{iocParam.timeRange.startDate} and departure_time < #{iocParam.timeRange.endDate} ]]>" +
- "</if>"+
- " GROUP BY parking_numbers ORDER BY hours" +
- "</script>")
- List<Park> getVacantList(@Param("iocParam") IocParam iocParam);
- }
|