| | |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | |
| | | IPage<EquipmentVO> pages = equipmentService.selectDeptPages(Condition.getPage(query), equipment, pid); |
| | | return R.data(pages); |
| | | IPage<EquipmentVO> page = equipmentService.selectDeptPages(Condition.getPage(query), equipment, pid); |
| | | |
| | | for (int j = 0; j < page.getRecords().size(); j++) { |
| | | String expireTime = page.getRecords().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类型的 |
| | | |
| | | if (expireTime != null){ |
| | | long st = sim.parse(expireTime).getTime(); |
| | | long en = sim.parse(end).getTime(); |
| | | //计算天数 |
| | | int day = (int) ((st - en) / 86400000); |
| | | if (day <= 30) { |
| | | page.getRecords().get(j).setType(1); |
| | | } else { |
| | | page.getRecords().get(j).setType(0); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return R.data(page); |
| | | } |
| | | |
| | | |
| | |
| | | // catalogService.updateCatalog(deviceName,deviceNumber,pId); |
| | | // } |
| | | |
| | | |
| | | System.out.println(equipment.getDeptId()); |
| | | return R.status(equipmentService.saveOrUpdate(equipment)); |
| | | } |
| | | |
| | |
| | | private String state; |
| | | private String reason; |
| | | |
| | | @TableField("deptId") |
| | | private String deptId; |
| | | |
| | | |
| | | } |
| | |
| | | update sys_equipment SET devicestate = 0 where id in (${arr}) |
| | | </update> |
| | | |
| | | <update id="updateOnes" parameterType="org.springblade.jfpt.equipment.entity.Equipment"> |
| | | update sys_equipment SET deviceName=#{deviceName},deviceNumber=#{deviceNumber},deviceType=#{deviceType}, |
| | | ownership=#{ownership},ownerId=#{yname},devicestate=#{devicestate},stime=#{stime}, |
| | | coordinate=POINT(#{jd},#{wd}),parent_id=#{parentId},jd=#{jd},wd=#{wd},addvcd=#{addvnm},street=#{streeName},dtype=#{dtype} where id=#{id} |
| | | </update> |
| | | |
| | | |
| | | <select id="selectInfo" resultMap="deptVOResultMap" |
| | | parameterType="org.springblade.jfpt.equipment.entity.Equipment"> |
| | | SELECT |
| | |
| | | private String oneId; |
| | | private String twoId; |
| | | private String threeId; |
| | | private String deptId; |
| | | |
| | | |
| | | } |