DistributionMapMapper.xml 1.1 KB

123456789101112131415161718192021222324252627282930
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zhili.dashboard.mapper.DistributionMapMapper">
  6. <update id="updateDistributionMap">
  7. -- 更新大屏数据库
  8. UPDATE tb_distribution_map t
  9. SET t.statis_date = REPLACE(DATE_ADD(t.statis_date,INTERVAL 1 DAY),'-','')
  10. </update>
  11. <select id="getDeviceStatusList" resultType="Map">
  12. select sum(car_num) * 20000 as quantity, statis_hours as num, stat_flg as item,statis_date
  13. from tb_distribution_map
  14. where is_delete = 0
  15. and ((statis_date = #{dateStr} and statis_hours &lt;= #{hourStr}) or (statis_date = #{yesStr} and statis_hours &gt;= #{yesHourStr}))
  16. group by item,num,statis_date,statis_hours
  17. order by statis_date ,statis_hours
  18. </select>
  19. <select id="getOnLine" resultType="Map">
  20. select sum(car_num) * 20000 as total
  21. from tb_distribution_map
  22. where is_delete = 0
  23. and statis_date = #{dateStr}
  24. and statis_hours = #{hourStr}
  25. </select>
  26. </mapper>