package com.wgcloud.service; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.wgcloud.entity.ShellState; import com.wgcloud.mapper.ShellStateMapper; import com.wgcloud.util.DateUtil; import com.wgcloud.util.UUIDUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; /** * @version v3.3 * @ClassName:ShellStateService.java * @author: http://www.wgstart.com * @date: 2021年8月19日 * @Description: ShellStateService.java * @Copyright: 2019-2021 wgcloud. All rights reserved. */ @Service public class ShellStateService { public PageInfo selectByParams(Map params, int currPage, int pageSize) throws Exception { PageHelper.startPage(currPage, pageSize); List list = shellStateMapper.selectByParams(params); PageInfo pageInfo = new PageInfo(list); return pageInfo; } public void save(ShellState ShellState) throws Exception { ShellState.setId(UUIDUtil.getUUID()); ShellState.setCreateTime(DateUtil.getNowTime()); shellStateMapper.save(ShellState); } public void updateById(ShellState ShellState) throws Exception { shellStateMapper.updateById(ShellState); } public void saveRecord(List recordList) throws Exception { if (recordList.size() < 1) { return; } for (ShellState as : recordList) { as.setId(UUIDUtil.getUUID()); } shellStateMapper.insertList(recordList); } public int deleteByShellId(String shellId) throws Exception { return shellStateMapper.deleteByShellId(shellId); } @Transactional public int updateSendByIds(String[] id) throws Exception { return shellStateMapper.updateSendByIds(id); } public int countByParams(Map params) throws Exception { return shellStateMapper.countByParams(params); } public int deleteById(String[] id) throws Exception { return shellStateMapper.deleteById(id); } public ShellState selectById(String id) throws Exception { return shellStateMapper.selectById(id); } public List selectAllByParams(Map params) throws Exception { return shellStateMapper.selectAllByParams(params); } public int deleteByDate(Map map) throws Exception { return shellStateMapper.deleteByDate(map); } @Autowired private ShellStateMapper shellStateMapper; }