Commit d8f1776f authored by tangwei's avatar tangwei

排除null

parent 5103c452
......@@ -16,19 +16,22 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
import java.util.Map;
/**
* 微型消防站服务实现类
*
* @author system_generator
* @date 2021-06-28
*/
* 微型消防站服务实现类
*
* @author system_generator
* @date 2021-06-28
*/
@Service
public class FireStationServiceImpl extends BaseService<FireStationDto,FireStation,FireStationMapper> implements IFireStationService {
public class FireStationServiceImpl extends BaseService<FireStationDto, FireStation, FireStationMapper>
implements IFireStationService {
@Autowired
FireStationMapper fireStationMapper;
@Autowired
OrgUsrMapper orgUsrMapper;
/**
* 分页查询
*/
......@@ -40,12 +43,13 @@ public class FireStationServiceImpl extends BaseService<FireStationDto,FireStati
* 列表查询 示例
*/
public List<FireStationDto> queryForFireStationList() {
return this.queryForList("" , false);
return this.queryForList("", false);
}
/**
* 删除
* */
public Boolean updateisDelete( Long sequenceNbr) {
*/
public Boolean updateisDelete(Long sequenceNbr) {
return this.update(new UpdateWrapper<FireStation>().eq("sequence_nbr", sequenceNbr).set("is_delete", 1));
}
......@@ -53,7 +57,7 @@ public class FireStationServiceImpl extends BaseService<FireStationDto,FireStati
@Override
public Page<FireStationDto> getFirefighters(int pageNum, int pageSize, FireStationDto par) {
List<FireStationDto> list = fireStationMapper.getFireStation((pageNum - 1) * pageSize, pageSize, par);
Map<String, Long> num = fireStationMapper.getFireStationCount( par);
Map<String, Long> num = fireStationMapper.getFireStationCount(par);
Page<FireStationDto> pageBean = new Page<>(pageNum, pageSize, num.get("num"));
return pageBean.setRecords(list);
}
......@@ -62,24 +66,30 @@ public class FireStationServiceImpl extends BaseService<FireStationDto,FireStati
*
* 新增
*
* ***/
***/
public FireStationDto add(FireStationDto model) {
OrgUsr orgUsr=orgUsrMapper.selectById(model.getBizCompanyId());
if (model.getBizCompanyId() != null) {
OrgUsr orgUsr = orgUsrMapper.selectById(model.getBizCompanyId());
model.setBizCompany(orgUsr.getBizOrgName());
model.setBizCompanyCode(orgUsr.getBizOrgCode());
}
FireStation entity = this.prepareEntity(model);
this.save(entity);
return Bean.toModel(entity, model);
}
/**
*
* 修改
*
* ***/
***/
public FireStationDto Update(FireStationDto model) {
OrgUsr orgUsr=orgUsrMapper.selectById(model.getBizCompanyId());
if (model.getBizCompanyId() != null) {
OrgUsr orgUsr = orgUsrMapper.selectById(model.getBizCompanyId());
model.setBizCompany(orgUsr.getBizOrgName());
model.setBizCompanyCode(orgUsr.getBizOrgCode());
}
FireStation entity = this.prepareEntity(model);
this.updateById(entity);
return Bean.toModel(entity, model);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment