| | |
| | | registry.addResourceHandler("*.html").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); |
| | | registry.addResourceHandler("/service-worker.js").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("*.js").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("*.json").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("*.txt").addResourceLocations("classpath:/META-INF/resources/"); |
| | | //registry.addResourceHandler("/favicon.ico").addResourceLocations("classpath:/META-INF/resources/"); |
| | | super.addResourceHandlers(registry); |
| | | //registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/"); |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.AFEInverterState; |
| | | import com.whyc.pojo.CentralMonitorSysRT; |
| | | import com.whyc.service.CentralMonitorSysCtrlService; |
| | | import com.whyc.service.CentralMonitorSysRTService; |
| | |
| | | return service.getInfoByDevId(devId); |
| | | } |
| | | |
| | | /** |
| | | * ======History====== |
| | | * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询 |
| | | * TODO 待确定是否需要加上日期 |
| | | * */ |
| | | @GetMapping("history/all") |
| | | @ApiOperation(value = "查询历史记录") |
| | | public Response<PageInfo<CentralMonitorSysRT>> getHistory(@RequestParam int pageNum, int pageSize, int devId){ |
| | | return service.getHistory(pageNum,pageSize,devId); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.CentralMonitorSysRT; |
| | | import com.whyc.pojo.CentralMonitorSysST; |
| | | import com.whyc.service.CentralMonitorSysRTService; |
| | | import com.whyc.service.CentralMonitorSysSTService; |
| | |
| | | return service.getInfoByDevId(devId); |
| | | } |
| | | |
| | | /** |
| | | * ======History====== |
| | | * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询 |
| | | * TODO 待确定是否需要加上日期 |
| | | * */ |
| | | @GetMapping("history/all") |
| | | @ApiOperation(value = "查询历史记录") |
| | | public Response<PageInfo<CentralMonitorSysST>> getHistory(@RequestParam int pageNum, int pageSize, int devId){ |
| | | return service.getHistory(pageNum,pageSize,devId); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.AFERectifierState; |
| | | import com.whyc.pojo.OilComm; |
| | | import com.whyc.service.OilCommService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | return service.getInfoByDevId(devId); |
| | | } |
| | | |
| | | /** |
| | | * ======History====== |
| | | * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询 |
| | | * TODO 待确定是否需要加上日期 |
| | | * */ |
| | | @GetMapping("history/all") |
| | | @ApiOperation(value = "查询历史记录") |
| | | public Response<PageInfo<OilComm>> getHistory(@RequestParam int pageNum, int pageSize, int devId){ |
| | | return service.getHistory(pageNum,pageSize,devId); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.CentralMonitorSysST; |
| | | import com.whyc.pojo.RectifierPowerRT; |
| | | import com.whyc.service.RectifierPowerService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | return service.getInfoByDevId(devId); |
| | | } |
| | | |
| | | /** |
| | | * ======History====== |
| | | * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询 |
| | | * TODO 待确定是否需要加上日期 |
| | | * */ |
| | | @GetMapping("history/all") |
| | | @ApiOperation(value = "查询历史记录") |
| | | public Response<PageInfo<RectifierPowerRT>> getHistory(@RequestParam int pageNum, int pageSize, int devId){ |
| | | return service.getHistory(pageNum,pageSize,devId); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.OilComm; |
| | | import com.whyc.pojo.UPSComm; |
| | | import com.whyc.service.UPSCommService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | |
| | | return service.getStauts(); |
| | | } |
| | | |
| | | /** |
| | | * ======History====== |
| | | * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询 |
| | | * TODO 待确定是否需要加上日期 |
| | | * */ |
| | | @GetMapping("history/all") |
| | | @ApiOperation(value = "查询历史记录") |
| | | public Response<PageInfo<UPSComm>> getHistory(@RequestParam int pageNum, int pageSize, int devId){ |
| | | return service.getHistory(pageNum,pageSize,devId); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.OilComm; |
| | | import com.whyc.pojo.WaterComm; |
| | | import com.whyc.service.WaterCommService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | return service.getInfoByDevId(devId); |
| | | } |
| | | |
| | | /** |
| | | * ======History====== |
| | | * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询 |
| | | * TODO 待确定是否需要加上日期 |
| | | * */ |
| | | @GetMapping("history/all") |
| | | @ApiOperation(value = "查询历史记录") |
| | | public Response<PageInfo<WaterComm>> getHistory(@RequestParam int pageNum, int pageSize, int devId){ |
| | | return service.getHistory(pageNum,pageSize,devId); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.CentralMonitorSysRT; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface CentralMonitorSysRTHistoryMapper { |
| | | List<CentralMonitorSysRT> getHistory(List<String> tableNames); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.CentralMonitorSysST; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface CentralMonitorSysSTHistoryMapper { |
| | | List<CentralMonitorSysST> getHistory(List<String> tableNames); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.OilComm; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface OilCommHistoryMapper { |
| | | List<OilComm> getHistory(List<String> tableNames); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.RectifierPowerRT; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface RectifierPowerHistoryMapper { |
| | | List<RectifierPowerRT> getHistory(List<String> tableNames); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.UPSComm; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface UPSCommHistoryMapper { |
| | | List<UPSComm> getHistory(List<String> tableNames); |
| | | } |
New file |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.pojo.WaterComm; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface WaterCommHistoryMapper { |
| | | List<WaterComm> getHistory(List<String> tableNames); |
| | | } |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.CentralMonitorSysRTHistoryMapper; |
| | | import com.whyc.mapper.CentralMonitorSysRTMapper; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.AFERectifierState; |
| | | import com.whyc.pojo.CentralMonitorSysRT; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class CentralMonitorSysRTService { |
| | | |
| | | @Resource |
| | | private CentralMonitorSysRTMapper mapper; |
| | | |
| | | @Resource |
| | | private CentralMonitorSysRTHistoryMapper historyMapper; |
| | | |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | public Response getInfoByDevId(int devId) { |
| | | QueryWrapper<CentralMonitorSysRT> queryWrapper = new QueryWrapper<>(); |
| | |
| | | return new Response<>().setCode(0); |
| | | } |
| | | } |
| | | |
| | | public Response<PageInfo<CentralMonitorSysRT>> getHistory(int pageNum, int pageSize, int devId) { |
| | | List<String> tableNames = commonMapper.getTableName("db_3.5mw_motor_history", "tb_central_monitor_sys_rt_" + devId); |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<CentralMonitorSysRT> centralMonitorSysRTs = historyMapper.getHistory(tableNames); |
| | | PageInfo<CentralMonitorSysRT> centralMonitorSysRTPageInfo = new PageInfo<>(centralMonitorSysRTs); |
| | | return new Response<PageInfo<CentralMonitorSysRT>>().set(1,centralMonitorSysRTPageInfo); |
| | | } |
| | | } |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.CentralMonitorSysRTMapper; |
| | | import com.whyc.mapper.CentralMonitorSysSTHistoryMapper; |
| | | import com.whyc.mapper.CentralMonitorSysSTMapper; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.CentralMonitorSysRT; |
| | | import com.whyc.pojo.CentralMonitorSysST; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class CentralMonitorSysSTService { |
| | | @Resource |
| | | private CentralMonitorSysSTMapper mapper; |
| | | |
| | | @Resource |
| | | private CentralMonitorSysSTHistoryMapper historyMapper; |
| | | |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | public Response getInfoByDevId(int devId) { |
| | | QueryWrapper<CentralMonitorSysST> queryWrapper = new QueryWrapper<>(); |
| | |
| | | } |
| | | } |
| | | |
| | | public Response<PageInfo<CentralMonitorSysST>> getHistory(int pageNum, int pageSize, int devId) { |
| | | List<String> tableNames = commonMapper.getTableName("db_3.5mw_motor_history", "tb_central_monitor_sys_st_" + devId); |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<CentralMonitorSysST> centralMonitorSysSTs = historyMapper.getHistory(tableNames); |
| | | PageInfo<CentralMonitorSysST> centralMonitorSysSTPageInfo = new PageInfo<>(centralMonitorSysSTs); |
| | | return new Response<PageInfo<CentralMonitorSysST>>().set(1,centralMonitorSysSTPageInfo); |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.mapper.OilCommHistoryMapper; |
| | | import com.whyc.mapper.OilCommMapper; |
| | | import com.whyc.pojo.CentralMonitorSysST; |
| | | import com.whyc.pojo.OilComm; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private OilCommMapper mapper; |
| | | |
| | | @Resource |
| | | private OilCommHistoryMapper historyMapper; |
| | | |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | public Response<List<OilComm>> getAll() { |
| | | try { |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | public Response<PageInfo<OilComm>> getHistory(int pageNum, int pageSize, int devId) { |
| | | List<String> tableNames = commonMapper.getTableName("db_3.5mw_motor_history", "tb_oil_comm_" + devId); |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<OilComm> oilComms = historyMapper.getHistory(tableNames); |
| | | PageInfo<OilComm> oilCommPageInfo = new PageInfo<>(oilComms); |
| | | return new Response<PageInfo<OilComm>>().set(1,oilCommPageInfo); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.mapper.RectifierPowerHistoryMapper; |
| | | import com.whyc.mapper.RectifierPowerMapper; |
| | | import com.whyc.pojo.CentralMonitorSysST; |
| | | import com.whyc.pojo.RectifierPowerRT; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.sql.Wrapper; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class RectifierPowerService { |
| | | |
| | | @Resource |
| | | private RectifierPowerMapper mapper; |
| | | |
| | | @Resource |
| | | private RectifierPowerHistoryMapper historyMapper; |
| | | |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | public Response<IPage<RectifierPowerRT>> getAll(int pageNum, int pageSize) { |
| | | IPage<RectifierPowerRT> rectifierPowerRTIPage = mapper.selectPage(new Page<>(pageNum, pageSize), null); |
| | |
| | | RectifierPowerRT rectifierPowerRT = mapper.selectOne(query); |
| | | return new Response<RectifierPowerRT>().set(1,rectifierPowerRT); |
| | | } |
| | | |
| | | public Response<PageInfo<RectifierPowerRT>> getHistory(int pageNum, int pageSize, int devId) { |
| | | List<String> tableNames = commonMapper.getTableName("db_3.5mw_motor_history", "tb_rectifier_power_" + devId); |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<RectifierPowerRT> rectifierPowerRTs = historyMapper.getHistory(tableNames); |
| | | PageInfo<RectifierPowerRT> rectifierPowerRTPageInfo = new PageInfo<>(rectifierPowerRTs); |
| | | return new Response<PageInfo<RectifierPowerRT>>().set(1,rectifierPowerRTPageInfo); |
| | | } |
| | | } |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.mapper.UPSCommHistoryMapper; |
| | | import com.whyc.mapper.UPSCommMapper; |
| | | import com.whyc.pojo.OilComm; |
| | | import com.whyc.pojo.UPSComm; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * UPS通讯 |
| | |
| | | @Resource |
| | | private UPSCommMapper mapper; |
| | | |
| | | @Resource |
| | | private UPSCommHistoryMapper historyMapper; |
| | | |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | public Response getStauts() { |
| | | try { |
| | | UPSComm ups = mapper.selectOne(null); |
| | |
| | | return new Response().setCode(0); |
| | | } |
| | | } |
| | | |
| | | public Response<PageInfo<UPSComm>> getHistory(int pageNum, int pageSize, int devId) { |
| | | List<String> tableNames = commonMapper.getTableName("db_3.5mw_motor_history", "tb_ups_comm_" + devId); |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<UPSComm> uPSComms = historyMapper.getHistory(tableNames); |
| | | PageInfo<UPSComm> uPSCommPageInfo = new PageInfo<>(uPSComms); |
| | | return new Response<PageInfo<UPSComm>>().set(1,uPSCommPageInfo); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.mapper.WaterCommHistoryMapper; |
| | | import com.whyc.mapper.WaterCommMapper; |
| | | import com.whyc.pojo.UPSComm; |
| | | import com.whyc.pojo.WaterComm; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private WaterCommMapper mapper; |
| | | |
| | | @Resource |
| | | private WaterCommHistoryMapper historyMapper; |
| | | |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | public Response<List<WaterComm>> getAll() { |
| | | try { |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | public Response<PageInfo<WaterComm>> getHistory(int pageNum, int pageSize, int devId) { |
| | | List<String> tableNames = commonMapper.getTableName("db_3.5mw_motor_history", "tb_water_comm_" + devId); |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<WaterComm> waterComms = historyMapper.getHistory(tableNames); |
| | | PageInfo<WaterComm> waterCommPageInfo = new PageInfo<>(waterComms); |
| | | return new Response<PageInfo<WaterComm>>().set(1,waterCommPageInfo); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.CentralMonitorSysRTHistoryMapper" > |
| | | |
| | | |
| | | <select id="getHistory" resultType="com.whyc.pojo.CentralMonitorSysRT"> |
| | | <foreach collection="list" item="tableName" separator="union all"> |
| | | select * from `db_3.5mw_motor_history`.${tableName} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.CentralMonitorSysSTHistoryMapper" > |
| | | |
| | | |
| | | <select id="getHistory" resultType="com.whyc.pojo.CentralMonitorSysST"> |
| | | <foreach collection="list" item="tableName" separator="union all"> |
| | | select * from `db_3.5mw_motor_history`.${tableName} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.OilCommHistoryMapper" > |
| | | |
| | | |
| | | <select id="getHistory" resultType="com.whyc.pojo.OilComm"> |
| | | <foreach collection="list" item="tableName" separator="union all"> |
| | | select * from `db_3.5mw_motor_history`.${tableName} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.RectifierPowerHistoryMapper" > |
| | | |
| | | <select id="getHistory" resultType="com.whyc.pojo.RectifierPowerRT"> |
| | | <foreach collection="list" item="tableName" separator="union all"> |
| | | select * from `db_3.5mw_motor_history`.${tableName} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.UPSCommHistoryMapper" > |
| | | |
| | | |
| | | <select id="getHistory" resultType="com.whyc.pojo.UPSComm"> |
| | | <foreach collection="list" item="tableName" separator="union all"> |
| | | select * from `db_3.5mw_motor_history`.${tableName} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.whyc.mapper.WaterCommHistoryMapper" > |
| | | |
| | | |
| | | <select id="getHistory" resultType="com.whyc.pojo.WaterComm"> |
| | | <foreach collection="list" item="tableName" separator="union all"> |
| | | select * from `db_3.5mw_motor_history`.${tableName} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |