给角色查询增加备注的查询条件

This commit is contained in:
季圣华
2023-03-06 23:12:48 +08:00
parent f4905dbe0e
commit 7b0a69ef79
4 changed files with 19 additions and 7 deletions

View File

@@ -12,11 +12,13 @@ public interface RoleMapperEx {
List<RoleEx> selectByConditionRole(
@Param("name") String name,
@Param("description") String description,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
Long countsByRole(
@Param("name") String name);
@Param("name") String name,
@Param("description") String description);
int batchDeleteRoleByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);

View File

@@ -32,14 +32,16 @@ public class RoleComponent implements ICommonQuery {
private List<?> getRoleList(Map<String, String> map) throws Exception{
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
return roleService.select(name, QueryUtils.offset(map), QueryUtils.rows(map));
String description = StringUtil.getInfo(search, "description");
return roleService.select(name, description, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map) throws Exception{
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
return roleService.countRole(name);
String description = StringUtil.getInfo(search, "description");
return roleService.countRole(name, description);
}
@Override

View File

@@ -75,10 +75,10 @@ public class RoleService {
return list;
}
public List<RoleEx> select(String name, int offset, int rows)throws Exception {
public List<RoleEx> select(String name, String description, int offset, int rows)throws Exception {
List<RoleEx> list=null;
try{
list=roleMapperEx.selectByConditionRole(name, offset, rows);
list=roleMapperEx.selectByConditionRole(name, description, offset, rows);
for(RoleEx roleEx: list) {
String priceLimit = roleEx.getPriceLimit();
if(StringUtil.isNotEmpty(priceLimit)) {
@@ -94,10 +94,10 @@ public class RoleService {
return list;
}
public Long countRole(String name)throws Exception {
public Long countRole(String name, String description)throws Exception {
Long result=null;
try{
result=roleMapperEx.countsByRole(name);
result=roleMapperEx.countsByRole(name, description);
}catch(Exception e){
JshException.readFail(logger, e);
}