Commit 08baac0c authored by hanfeng's avatar hanfeng

客户管理

parent 8d4043b2
......@@ -19,7 +19,7 @@ public class AppStaffUserBiz extends BaseBiz<AppStaffUserMapper, AppStaffUser> {
public List<AppStaffUser> getAll(Integer id) {
Example example = new Example(AppStaffUser.class);
example.createCriteria().andEqualTo("suId",id).andEqualTo("isdel",0);
example.createCriteria().andEqualTo("suId",id).andEqualTo("isDel",0);
return selectByExample(example);
}
......@@ -40,14 +40,19 @@ public class AppStaffUserBiz extends BaseBiz<AppStaffUserMapper, AppStaffUser> {
public AppStaffUser findOne(AppStaffUser appStaffUser) {
Example example= new Example(AppStaffUser.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel",0);
if (appStaffUser.getId()!=null) {
criteria.andEqualTo("id",appStaffUser.getId());
return mapper.selectOneByExample(example);
}
if (appStaffUser.getPhone()!=null){
criteria.andEqualTo("phone",appStaffUser.getPhone());
}
return mapper.selectOneByExample(example);
}
return null;
}
}
......@@ -39,7 +39,7 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
public List<AppStaffUser> all() throws Exception {
AppUserDTO userDTO = (AppUserDTO) publicController.userDetailByToken(authConfig.getToken(request)).getData();
if (POSITION_NAME.equals(userDTO.getPositionName())) {
baseBiz.getAll(userDTO.getId()) ;
return baseBiz.getAll(userDTO.getUserid()) ;
}
return new ArrayList<>();
}
......@@ -56,7 +56,7 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
@ApiOperation("查询一条")
@PostMapping(value = "one")
public ObjectRestResponse<AppStaffUser> findOne(@RequestParam AppStaffUser appStaffUser) {
public ObjectRestResponse<AppStaffUser> findOne(AppStaffUser appStaffUser) {
AppStaffUser staffUser = baseBiz.findOne(appStaffUser);
if (staffUser!=null) {
return ObjectRestResponse.succ(staffUser);
......@@ -70,7 +70,7 @@ public class AppStaffUserController extends BaseController<AppStaffUserBiz, AppS
AppStaffUser staffUser = new AppStaffUser();
staffUser.setId(id);
staffUser.setIsDel(1);
baseBiz.updateById(staffUser);
baseBiz.updateSelectiveById(staffUser);
return ObjectRestResponse.succ();
}
......
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