package cn.com.goldenwater.dcproj.service.impl; import cn.com.goldenwater.core.service.AbstractCrudService; import cn.com.goldenwater.dcproj.dao.ChkSafeSelsProjDao; import cn.com.goldenwater.dcproj.model.ChkSafeSelsProj; import cn.com.goldenwater.dcproj.param.ChkSafeSelsProjParam; import cn.com.goldenwater.dcproj.service.ChkSafeSelsProjService; import cn.com.goldenwater.id.util.UuidUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.List; /** * 成都市水务安全生产"护安"监管执法专项行动项目类型Service业务层处理 * * @author ruoyi * @date 2023-02-21 */ @Service @Transactional public class ChkSafeSelsProjServiceImpl extends AbstractCrudService implements ChkSafeSelsProjService { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private ChkSafeSelsProjDao chkSafeSelsProjDao; public ChkSafeSelsProjServiceImpl(ChkSafeSelsProjDao chkSafeSelsProjDao) { super(chkSafeSelsProjDao); this.chkSafeSelsProjDao = chkSafeSelsProjDao; } /** * 增加成都市水务安全生产"护安"监管执法专项行动项目类型 * * @return 成都市水务安全生产"护安"监管执法专项行动项目类型 */ @Override public int insert(ChkSafeSelsProj chkSafeSelsProj) { logger.debug("ChkSafeSelsProj 新增"); String uuid = UuidUtil.uuid(); // 生成uuid chkSafeSelsProj.setId(uuid); chkSafeSelsProj.setIntm(new Date()); chkSafeSelsProj.setUptm(new Date()); chkSafeSelsProj.setDataStat("0"); return this.chkSafeSelsProjDao.insert(chkSafeSelsProj); } /** * 更新 成都市水务安全生产"护安"监管执法专项行动项目类型 * * @param chkSafeSelsProj 成都市水务安全生产"护安"监管执法专项行动项目类型主键 * @return 成都市水务安全生产"护安"监管执法专项行动项目类型 */ @Override public int update(ChkSafeSelsProj chkSafeSelsProj) { logger.debug("ChkSafeSelsProj 更新"); chkSafeSelsProj.setUptm(new Date()); return this.chkSafeSelsProjDao.update(chkSafeSelsProj); } /** * 主键删除 成都市水务安全生产"护安"监管执法专项行动项目类型 * * @param id 成都市水务安全生产"护安"监管执法专项行动项目类型主键 * @return 成都市水务安全生产"护安"监管执法专项行动项目类型 */ @Override public int delete(String id) { logger.debug("ChkSafeSelsProj 删除"); return this.chkSafeSelsProjDao.delete(id); } /** * 查询专项检查表的 项目类型 * pid 0 查询全部 * pid null 查询根节点 * pid val 查询val的子节点 * @param chkSafeSelsProjParam * @return */ @Override public List querySelectOptions (ChkSafeSelsProjParam chkSafeSelsProjParam){ if(null == chkSafeSelsProjParam){ chkSafeSelsProjParam = new ChkSafeSelsProjParam(); } chkSafeSelsProjParam.setUseScope("1"); chkSafeSelsProjParam.setDataStat("0"); if( "0".equals(chkSafeSelsProjParam.getPid()) ){ return this.chkSafeSelsProjDao.findList(chkSafeSelsProjParam); }else if( null == chkSafeSelsProjParam.getPid()){ return this.chkSafeSelsProjDao.findSIRootList(); }else{ return this.chkSafeSelsProjDao.findList(chkSafeSelsProjParam); } } /** * 根查询安全生产监督检查台账的 项目类型 * pid 0 查询全部 * pid null 查询根节点 * pid val 查询val的子节点 * @param chkSafeSelsProjParam * @return */ @Override public List queryLedgerSelectOptions (ChkSafeSelsProjParam chkSafeSelsProjParam){ if(null == chkSafeSelsProjParam){ chkSafeSelsProjParam = new ChkSafeSelsProjParam(); } chkSafeSelsProjParam.setUseScope("2"); chkSafeSelsProjParam.setDataStat("0"); if( "0".equals(chkSafeSelsProjParam.getPid()) ){ return this.chkSafeSelsProjDao.findList(chkSafeSelsProjParam); }else if( null == chkSafeSelsProjParam.getPid()){ return this.chkSafeSelsProjDao.findLedgerRootList(); }else{ return this.chkSafeSelsProjDao.findList(chkSafeSelsProjParam); } } }