提交 | 用户 | 时间
|
71e81e
|
1 |
package cn.stylefeng.guns.modular.em.equipmentMaintainContentPlan.service.impl; |
懒 |
2 |
|
|
3 |
import cn.stylefeng.guns.base.pojo.page.LayuiPageFactory; |
|
4 |
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo; |
|
5 |
import cn.stylefeng.guns.modular.em.equipmentMaintainContentPlan.entity.EquipmentMaintainContentPlan; |
|
6 |
import cn.stylefeng.guns.modular.em.equipmentMaintainContentPlan.mapper.EquipmentMaintainContentPlanMapper; |
|
7 |
import cn.stylefeng.guns.modular.em.equipmentMaintainContentPlan.model.params.EquipmentMaintainContentPlanParam; |
|
8 |
import cn.stylefeng.guns.modular.em.equipmentMaintainContentPlan.model.result.EquipmentMaintainContentPlanResult; |
|
9 |
import cn.stylefeng.guns.modular.em.equipmentMaintainContentPlan.service.EquipmentMaintainContentPlanService; |
|
10 |
import cn.stylefeng.roses.core.util.ToolUtil; |
|
11 |
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
12 |
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
13 |
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
14 |
import org.springframework.stereotype.Service; |
|
15 |
|
|
16 |
import java.io.Serializable; |
|
17 |
import java.util.List; |
|
18 |
|
|
19 |
/** |
|
20 |
* <p> |
|
21 |
* 计划保养内容 服务实现类 |
|
22 |
* </p> |
|
23 |
* |
|
24 |
* @author ruimin |
|
25 |
* @since 2023-02-20 |
|
26 |
*/ |
|
27 |
@Service |
|
28 |
public class EquipmentMaintainContentPlanServiceImpl extends ServiceImpl<EquipmentMaintainContentPlanMapper, EquipmentMaintainContentPlan> implements EquipmentMaintainContentPlanService { |
|
29 |
|
|
30 |
@Override |
|
31 |
public void add(EquipmentMaintainContentPlanParam param){ |
|
32 |
EquipmentMaintainContentPlan entity = getEntity(param); |
|
33 |
this.save(entity); |
|
34 |
} |
|
35 |
|
|
36 |
@Override |
|
37 |
public void delete(EquipmentMaintainContentPlanParam param){ |
|
38 |
this.removeById(getKey(param)); |
|
39 |
} |
|
40 |
|
|
41 |
@Override |
|
42 |
public void update(EquipmentMaintainContentPlanParam param){ |
|
43 |
EquipmentMaintainContentPlan oldEntity = getOldEntity(param); |
|
44 |
EquipmentMaintainContentPlan newEntity = getEntity(param); |
|
45 |
ToolUtil.copyProperties(newEntity, oldEntity); |
|
46 |
this.updateById(newEntity); |
|
47 |
} |
|
48 |
|
|
49 |
@Override |
|
50 |
public EquipmentMaintainContentPlanResult findBySpec(EquipmentMaintainContentPlanParam param){ |
|
51 |
return null; |
|
52 |
} |
|
53 |
|
|
54 |
@Override |
|
55 |
public List<EquipmentMaintainContentPlanResult> findListBySpec(EquipmentMaintainContentPlanParam param){ |
|
56 |
return null; |
|
57 |
} |
|
58 |
|
|
59 |
@Override |
|
60 |
public LayuiPageInfo findPageBySpec(EquipmentMaintainContentPlanParam param){ |
|
61 |
Page pageContext = getPageContext(); |
|
62 |
IPage page = this.baseMapper.customPageList(pageContext, param); |
|
63 |
return LayuiPageFactory.createPageInfo(page); |
|
64 |
} |
|
65 |
|
|
66 |
private Serializable getKey(EquipmentMaintainContentPlanParam param){ |
|
67 |
return param.getId(); |
|
68 |
} |
|
69 |
|
|
70 |
private Page getPageContext() { |
|
71 |
return LayuiPageFactory.defaultPage(); |
|
72 |
} |
|
73 |
|
|
74 |
private EquipmentMaintainContentPlan getOldEntity(EquipmentMaintainContentPlanParam param) { |
|
75 |
return this.getById(getKey(param)); |
|
76 |
} |
|
77 |
|
|
78 |
private EquipmentMaintainContentPlan getEntity(EquipmentMaintainContentPlanParam param) { |
|
79 |
EquipmentMaintainContentPlan entity = new EquipmentMaintainContentPlan(); |
|
80 |
ToolUtil.copyProperties(param, entity); |
|
81 |
return entity; |
|
82 |
} |
|
83 |
|
|
84 |
} |