package com.iailab.module.pms.service.demo;
|
|
import com.iailab.framework.common.pojo.PageResult;
|
import com.iailab.framework.common.util.object.BeanUtils;
|
import com.iailab.module.pms.controller.admin.demo.vo.DemoPageReqVO;
|
import com.iailab.module.pms.controller.admin.demo.vo.DemoSaveReqVO;
|
import com.iailab.module.pms.dal.dataobject.demo.DemoDO;
|
import com.iailab.module.pms.dal.mysql.demo.DemoMapper;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
|
/**
|
* @author PanZhibao
|
* @Description
|
* @createTime 2024年08月17日
|
*/
|
@Service
|
@Slf4j
|
public class DemoServiceImpl implements DemoService {
|
|
@Resource
|
private DemoMapper demoMapper;
|
|
|
@Override
|
public Long create(DemoSaveReqVO createReqVO) {
|
DemoDO demo = BeanUtils.toBean(createReqVO, DemoDO.class);
|
demoMapper.insert(demo);
|
return demo.getId();
|
}
|
|
@Override
|
public Long update(DemoSaveReqVO createReqVO) {
|
DemoDO demo = BeanUtils.toBean(createReqVO, DemoDO.class);
|
demoMapper.updateById(demo);
|
return demo.getId();
|
}
|
|
@Override
|
public void delete(Long id) {
|
demoMapper.deleteById(id);
|
}
|
|
@Override
|
public DemoDO getInfo(Long id) {
|
return demoMapper.selectById(id);
|
}
|
|
@Override
|
public PageResult<DemoDO> getPage(DemoPageReqVO pageReqVO) {
|
return demoMapper.selectPage(pageReqVO);
|
}
|
|
}
|