
数据库
农场主
这个作者很懒,什么都没留下…
展开
-
timestamp类型以天为单位进行分组
这个为题的关键点在于转换timestamp类型成以填为单位的格式,然后进行分组, <select id="getCountDataBytime" resultMap="CountData"> SELECT SUM(count_val_) AS count_val_,SUM(total_money_) AS total_money_,end_time_ FROM dt_hys_count where start_time_>=#{startTime} and end..原创 2020-09-10 20:14:00 · 853 阅读 · 0 评论 -
MyBatis中的SQL语句总结(不断更新) PS:要记得
主要还是总结真的有各种各样的好处啊 1.传入一个ID链表和开始时间,结束时间,根据时间以及ID遍历,得到的数据中的某一列(字段)相加 输入:List<Long> ids startTime endTime XML <select id="getElectricByDevIdsAndTimes" resultMap="ElectricHour"> select sum(total_power_)totalPower from dt_electric_hour...原创 2020-06-12 18:38:42 · 162 阅读 · 0 评论