| | |
| | | */ |
| | | public interface DeviceMapper extends BaseMapper<Device> { |
| | | |
| | | List<DeviceExcelDTO> ListDeviceExcel(@Param("startTime") String startTime,@Param("id") int id); |
| | | List<DeviceExcelDTO> ListDeviceExcel(@Param("startTime") String startTime,@Param("mon") String mon,@Param("id") int id); |
| | | } |
| | |
| | | List<Device> getDateByOrgId(int orgId); |
| | | |
| | | |
| | | List<DeviceExcelDTO> ListDeviceExcel(String startTime,String endTime,int id); |
| | | List<DeviceExcelDTO> ListDeviceExcel(String startTime,String mon,int id); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DeviceExcelDTO> ListDeviceExcel(String startTime, String endTime, int id) { |
| | | return this.baseMapper.ListDeviceExcel(startTime,id); |
| | | public List<DeviceExcelDTO> ListDeviceExcel(String startTime, String mon, int id) { |
| | | return this.baseMapper.ListDeviceExcel(startTime,mon,id); |
| | | } |
| | | } |
| | |
| | | |
| | | @XxlJob("emilTask") |
| | | public void emilTask()throws IOException { |
| | | String startTime = DateUtils.dateToDateString(DateUtils.addDays(new Date(),-1),DateUtils.yyyy_MM_dd_EN); |
| | | List<DeviceExcelDTO> list = deviceService.ListDeviceExcel(startTime,null,72); |
| | | Date date = DateUtils.addDays(new Date(),-1); |
| | | String startTime = DateUtils.dateToDateString(date,DateUtils.yyyy_MM_dd_EN); |
| | | String mon = DateUtils.dateToDateString(date,DateUtils.yyyyMM_EN); |
| | | List<DeviceExcelDTO> list = deviceService.ListDeviceExcel(startTime,mon,72); |
| | | String path = System.getProperty("user.dir")+"/"; |
| | | String fileName = String.format("%s疾控中心数据-%s.xlsx",path,startTime); |
| | | ByteArrayOutputStream out = null; |
| | |
| | | } |
| | | log.info("邮件发送成功"); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | Date date = DateUtils.addDays(new Date(),+1); |
| | | String startTime = DateUtils.dateToDateString(date,DateUtils.yyyy_MM_dd_EN); |
| | | String mon = DateUtils.dateToDateString(date,DateUtils.yyyyMM_EN); |
| | | System.out.println(startTime); |
| | | System.out.println(mon); |
| | | } |
| | | } |
| | |
| | | cast( t1.`value` -> '$.a99054' AS DOUBLE ) AS a99054 |
| | | FROM |
| | | device t |
| | | LEFT JOIN history_minutely_202401 t1 ON t1.mac = t.mac |
| | | LEFT JOIN history_minutely_${mon} t1 ON t1.mac = t.mac |
| | | WHERE |
| | | t.organization_id = #{id} |
| | | AND date(t1.time) <![CDATA[=]]> #{startTime} |