package com.meet.action; import java.util.List; import java.util.Map; import org.apache.struts2.interceptor.SessionAware; import com.meet.entity.Equipment; import com.meet.service.IEquipmentService; import com.opensymphony.xwork2.ActionSupport; /** * 设备控制层 * @author 琪琪 * */ public class EquipmentAction extends ActionSupport implements SessionAware { /** * */ private static final long serialVersionUID = 1L; private Map<String, Object> sessionMap; private Equipment equipment; private IEquipmentService equipmentService; /** * 添加 * @return * @throws Exception */ public String addEquipment() throws Exception{ if(equipment.getEquipmentid()==null){ equipmentService.addEquipment(equipment); }else{ updateEquipment(); } return "addEquipment"; } /** * 修改 * @return * @throws Exception */ public String updateEquipment() throws Exception{ equipmentService.updateEquipment(equipment); return "updateEquipment"; } /** * 删除 * @return * @throws Exception */ public String deleteEquipment() throws Exception{ equipmentService.deleteEquipment(equipment.getEquipmentid()); return "deleteEquipment"; } /** * 查找所有 * @return * @throws Exception */ public String findAllEquipment() throws Exception{ List<Equipment> equipmentList=equipmentService.findAllEquipment(); sessionMap.put("equipmentList", equipmentList); return "findAllEquipment"; } /** * 通过id查找 * @return * @throws Exception */ public String findByIdEquipment() throws Exception{ this.equipment=equipmentService.findByIdEquipment(equipment.getEquipmentid()); return "findByIdEquipment"; } public Equipment getEquipment() { return equipment; } public void setEquipment(Equipment equipment) { this.equipment = equipment; } public void setEquipmentService(IEquipmentService equipmentService) { this.equipmentService = equipmentService; } @Override public void setSession(Map<String, Object> sessionMap) { this.sessionMap=sessionMap; } }
最近下载更多
Henew168 LV2
3月11日
black8angel LV4
2023年12月21日
2036495585 LV9
2023年9月25日
ppppppan LV2
2022年10月13日
咸鱼到处寻码 LV6
2022年7月3日
zhaoyangwfd LV17
2022年6月21日
591231555 LV20
2022年4月18日
sunshine9920 LV12
2022年3月31日
听雨轩丿 LV10
2022年2月22日
HONG SIR LV8
2022年2月8日