| | |
| | | |
| | | @Select("select distinct producer from db_batt.power_inf where producer is not null") |
| | | List<String> getProducerList(); |
| | | |
| | | @Select("SELECT s.sinf_name as station_name,p.*,p.binf_id as battGroupId,p.binf_name as battGroupName from db_batt.power_inf p,db_batt.sinf_pinf sp,db_batt.station_inf s\n" + |
| | | "where p.power_id = sp.pinf_id and sp.sinf_id = s.sinf_id") |
| | | List<PowerInf> getList(); |
| | | |
| | | @Select("SELECT s.sinf_name as station_name,p.*,p.binf_id as battGroupId,p.binf_name as battGroupName from db_batt.power_inf p,db_batt.sinf_pinf sp,db_batt.station_inf s\n" + |
| | | "where p.power_id = sp.pinf_id and sp.sinf_id = s.sinf_id and power_id = #{powerId}") |
| | | PowerInf getById(int powerId); |
| | | |
| | | } |
| | |
| | | public Response getPage(int pageNum, int pageSize) { |
| | | PageHelper helper = new PageHelper(); |
| | | helper.startPage(pageNum,pageSize); |
| | | QueryWrapper<PowerInf> queryWrapper = Wrappers.query(); |
| | | /*QueryWrapper<PowerInf> queryWrapper = Wrappers.query(); |
| | | queryWrapper.orderByAsc("power_id"); |
| | | List<PowerInf> powerInfs = mapper.selectList(queryWrapper); |
| | | |
| | | List<PowerInf> powerInfs = mapper.selectList(queryWrapper);*/ |
| | | List<PowerInf> powerInfs = mapper.getList(); |
| | | PageInfo<PowerInf> pageInfo = new PageInfo<>(powerInfs); |
| | | return new Response().set(1,pageInfo); |
| | | |
| | | } |
| | | |
| | | public Response getById(int powerId) { |
| | | PowerInf powerInf = mapper.selectById(powerId); |
| | | //PowerInf powerInf = mapper.selectById(powerId); |
| | | PowerInf powerInf = mapper.getById(powerId); |
| | | return new Response().set(1,powerInf); |
| | | } |
| | | |