Commit 0c7d7cc9 authored by luzhuang's avatar luzhuang

corpid

parent 78a8e01a
......@@ -32,10 +32,13 @@ public class BLabelController extends PaginationController<BLabel> {
@ApiOperation(value="501 根据条件分页查询", notes="根据条件分页查询标签")
@ApiImplicitParam(name = "lName", value = "(标签名)模糊查询条件", required = false, dataType = "varchar")
@GetMapping(value = "/queryBlabelsByPagination")
public GridModel queryBlabelsByPagination(CurUser curUser, @Valid String lName, BindingResult br){
bLabelService.queryBlabelsByPagination(getPaginationUtility(),lName);
public Result queryBlabelsByPagination(CurUser curUser, @Valid String lName, BindingResult br){
bLabelService.queryBlabelsByPagination(getPaginationUtility(),lName,curUser.getCorpId());
GridModel gridModel = getGridModelResponse();
return gridModel;
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
gridModel);
}
@ApiOperation(value="502 物理删除", notes="根据ID删除一条记录")
......@@ -73,4 +76,14 @@ public class BLabelController extends PaginationController<BLabel> {
null);
}
@ApiOperation(value="505 根据条件查询", notes="根据条件查询标签")
@ApiImplicitParam(name = "lName", value = "(标签名)模糊查询条件", required = false, dataType = "varchar")
@GetMapping(value = "/queryBlabels")
public Result queryBlabels(CurUser curUser, @Valid String lName, BindingResult br){
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bLabelService.queryBlabels(lName,curUser.getCorpId()));
}
}
......@@ -12,10 +12,13 @@ public interface BLabelRepository extends BaseMapper<BLabel> {
// 查询所有数据
@Select("<script>SELECT * FROM b_label where del_flag != 1 and flag = 1 " +
" and corp_id = #{corpId}" +
"<if test=\"lName!=null and lName != ''\"> and l_name like CONCAT('%',#{lName},'%') </if>" +
"</script>")
@ResultMap(value = "BaseResultMap")
List<BLabel> queryBlabels(@Param("lName") String lName);
List<BLabel> queryBlabels(@Param("lName") String lName,@Param("corpId")String corpId);
// 增加标签是检查标签名重复
@Select("SELECT * from b_label where l_name=#{lName} AND del_flag='0' and flag='1'")
......
......@@ -8,7 +8,9 @@ import java.util.List;
public interface BLabelService {
List<BLabel> queryBlabelsByPagination(PageUtil pageUtil, String lName);
List<BLabel> queryBlabelsByPagination(PageUtil pageUtil, String lName,String corpId);
List<BLabel> queryBlabels(String lName,String corpId);
PersistModel insertLabel(BLabel bLabel);
......
......@@ -22,8 +22,13 @@ public class BLabelServiceImpl implements BLabelService {
private BLabelRepository bLabelRepository;
@Override
public List<BLabel> queryBlabelsByPagination(PageUtil pageUtil, String lName) {
return bLabelRepository.queryBlabels(lName);
public List<BLabel> queryBlabelsByPagination(PageUtil pageUtil, String lName,String corpId) {
return bLabelRepository.queryBlabels(lName,corpId);
}
@Override
public List<BLabel> queryBlabels(String lName,String corpId) {
return bLabelRepository.queryBlabels(lName,corpId);
}
@Override
......
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