package com.thhy.secure.modules.biz.regionHazardInform.service.impl; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.thhy.general.common.BasicResult; import com.thhy.general.config.SysUserInfo; import com.thhy.general.utils.UserInfoUtils; import com.thhy.secure.modules.biz.regionHazardInform.dto.TRegionHazardInformDto; import com.thhy.secure.modules.biz.regionHazardInform.entity.TRegionHazardInformEntity; import com.thhy.secure.modules.biz.regionHazardInform.mapper.TRegionHazardInformMapper; import com.thhy.secure.modules.biz.regionHazardInform.service.TRegionHazardInformService; import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * @Author QiuYuHao * @CreateDate 2023-09-26 13:44:04 * 危险告知源逻辑实现 */ @Service public class TRegionHazardInformServiceImpl implements TRegionHazardInformService { @Autowired private TRegionHazardInformMapper tRegionHazardInformMapper; @Override public BasicResult findAll(TRegionHazardInformDto tRegionHazardInformDto) { SysUserInfo userInfo = UserInfoUtils.getInstance().getUserInfo(); tRegionHazardInformDto.setCompanyId(userInfo.getCompanyId()); PageHelper.startPage(tRegionHazardInformDto.getPageNum(), tRegionHazardInformDto.getPageSize()); List all = this.tRegionHazardInformMapper.findAll(tRegionHazardInformDto); PageInfo pageInfo = new PageInfo<>(all); return BasicResult.success(pageInfo); } @Override public BasicResult findEntity(String id) { TRegionHazardInformEntity entity = this.tRegionHazardInformMapper.findEntity(id); return BasicResult.success(entity); } @Override public BasicResult insert(TRegionHazardInformEntity tRegionHazardInformEntity) { SysUserInfo userInfo = UserInfoUtils.getInstance().getUserInfo(); tRegionHazardInformEntity.setCompanyId(userInfo.getCompanyId()); tRegionHazardInformEntity.setCreateUser(userInfo.getRealName()); this.tRegionHazardInformMapper.insert(tRegionHazardInformEntity); return BasicResult.success(); } @Override public BasicResult update(TRegionHazardInformEntity tRegionHazardInformEntity) { this.tRegionHazardInformMapper.update(tRegionHazardInformEntity); return BasicResult.success(); } @Override public BasicResult delete(String id) { this.tRegionHazardInformMapper.delete(id); return BasicResult.success(); } }