forked from liweijie/education
属性信息填写及编号回填等梳理
This commit is contained in:
+17
-2
@@ -421,13 +421,28 @@ public class FacultyServiceImpl implements FacultyService {
|
||||
|
||||
@Override
|
||||
public JYSX getJYSXByJYBH(String jybh) {
|
||||
return jysxMapper.selectById(jybh);
|
||||
JYSX entity = jysxMapper.selectById(jybh);
|
||||
if (entity == null) {
|
||||
entity = new JYSX();
|
||||
entity.setJybh(jybh);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateJYSX(JYSX entity) {
|
||||
jysxMapper.updateById(entity);
|
||||
if (entity == null || isBlank(entity.getJybh())) {
|
||||
throw new BusinessException("教员编号不能为空");
|
||||
}
|
||||
// 教员属性与教员一对一,历史教员可能没有属性行:更新不到则补插
|
||||
int updated = jysxMapper.updateById(entity);
|
||||
if (updated == 0) {
|
||||
if (entity.getZr() == null) {
|
||||
entity.setZr(0);
|
||||
}
|
||||
jysxMapper.insert(entity);
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 年度综合评定查询 ====================
|
||||
|
||||
Reference in New Issue
Block a user