| | |
| | | } |
| | | |
| | | /** |
| | | * 查询所有 |
| | | */ |
| | | @GetMapping("/listAll") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入equipment") |
| | | public R<List<EquipmentVO>> listAll(Equipment equipment, Query query) throws ParseException { |
| | | List<EquipmentVO> pages = equipmentService.listAll(); |
| | | |
| | | for (int j = 0; j < pages.size(); j++) { |
| | | String expireTime = pages.get(j).getExpireTime(); |
| | | //1.获取当前时间 |
| | | Date dd = new Date(); |
| | | SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String end = sim.format(dd); |
| | | //把string类型转换为long类型的 |
| | | long st = sim.parse(expireTime).getTime(); |
| | | long en = sim.parse(end).getTime(); |
| | | //计算天数 |
| | | int day = (int) ((st - en) / 86400000); |
| | | if (day <= 30) { |
| | | pages.get(j).setType(1); |
| | | } else { |
| | | pages.get(j).setType(0); |
| | | } |
| | | } |
| | | |
| | | |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/pages") |
| | |
| | | */ |
| | | List<EquipmentVOS> tree(); |
| | | |
| | | List<EquipmentVO> listAll(); |
| | | |
| | | /** |
| | | * 懒加载部门列表 |
| | | * @param parentId |
| | |
| | | |
| | | <select id="selectEquipmentPage" resultMap="equipmentResultMap"> |
| | | select id,deviceName,deviceNumber,deviceType,ownership,ownerId,devicestate,stime,dtype,heartbeat,expireTime,pay, |
| | | parent_id, |
| | | parent_id,district,province,city, |
| | | jd , |
| | | wd , |
| | | street, |
| | |
| | | <if test="equipment.addvcd!=null"> |
| | | and addvcd=#{equipment.addvcd} |
| | | </if> |
| | | |
| | | <if test="equipment.district!=null"> |
| | | and district like concat('%',#{equipment.district},'%') |
| | | </if> |
| | | <if test="equipment.province!=null"> |
| | | and province like concat('%',#{equipment.province},'%') |
| | | </if> |
| | | <if test="equipment.city!=null"> |
| | | and city like concat('%',#{equipment.city},'%') |
| | | </if> |
| | | |
| | | <if test="equipment.devicestate!=null"> |
| | | and devicestate =#{equipment.devicestate} |
| | | </if> |
| | |
| | | select id, parent_id, deviceName as title, id as "value", id as "key" from sys_equipment |
| | | </select> |
| | | |
| | | <select id="listAll" resultMap="equipmentResultMap"> |
| | | select id,deviceName,deviceNumber,deviceType,ownership,ownerId,devicestate,stime,dtype,heartbeat,expireTime,pay, |
| | | parent_id, |
| | | jd , |
| | | wd , |
| | | street, |
| | | addvcd,pay,expireTime from sys_equipment |
| | | </select> |
| | | |
| | | |
| | | <select id="lazyList" resultMap="deptVOResultMap"> |
| | | SELECT dept.id,dept.deviceName,dept.deviceNumber,dept.deviceType,dept.ownership, |
| | |
| | | */ |
| | | List<EquipmentVOS> tree(); |
| | | |
| | | List<EquipmentVO> listAll(); |
| | | |
| | | void updateOne(Equipment equipment); |
| | | |
| | | void s(Equipment equipment); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<EquipmentVO> listAll() { |
| | | return baseMapper.listAll(); |
| | | } |
| | | |
| | | @Override |
| | | public void updateOne(Equipment equipment) { |
| | | baseMapper.updateOne(equipment); |
| | | } |