CarResourceMapMapper.java 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package com.nokia.financeapi.dao.car;
  2. import com.nokia.financeapi.pojo.dto.GetCarNoticeDto;
  3. import com.nokia.financeapi.pojo.dto.GetCarTypeStatDto;
  4. import com.nokia.financeapi.pojo.vo.GetCarNoticeVo;
  5. import com.nokia.financeapi.pojo.vo.GetCarTypeStatVo;
  6. import org.apache.ibatis.annotations.Mapper;
  7. import org.apache.ibatis.annotations.Param;
  8. import org.apache.ibatis.annotations.Select;
  9. import java.util.List;
  10. @Mapper
  11. public interface CarResourceMapMapper {
  12. /**
  13. * 获取公告
  14. */
  15. @Select("""
  16. select * from car.notices
  17. where city = #{dto.city}
  18. order by create_time desc
  19. """)
  20. List<GetCarNoticeVo> getNotice(@Param("dto") GetCarNoticeDto dto);
  21. /**
  22. * 获取全省或某个地市的车辆类型统计
  23. */
  24. @Select("""
  25. <script>
  26. select
  27. count(che_liang_lei_xing = '皮卡车' or null) as pkc,
  28. count(che_liang_lei_xing = '微型面包车' or null) as wxmbc,
  29. count(che_liang_lei_xing = '越野车' or null) as yyc,
  30. count(che_liang_lei_xing = '轿车' or null) as jc,
  31. count(che_liang_lei_xing not in ('皮卡车', '微型面包车', '越野车', '轿车') or null) as qtc
  32. from
  33. car.car_base_data_month
  34. where
  35. nian_yue = (
  36. select
  37. max(nian_yue)
  38. from
  39. car.car_base_data_month)
  40. <if test="dto.city != null and dto.city != ''">
  41. and city = #{dto.city}
  42. </if>
  43. </script>
  44. """)
  45. GetCarTypeStatVo getCarTypeStat(@Param("dto") GetCarTypeStatDto dto);
  46. }