Search in sources :

Example 6 with Example

use of tk.mybatis.mapper.entity.Example in project paascloud-master by paascloud.

the class UacActionCommonController method checkActionCode.

/**
 * 检测权限编码是否已存在
 *
 * @param uacActionCheckCodeDto the uac action check code dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkActionCode")
@ApiOperation(httpMethod = "POST", value = "检测权限编码是否已存在")
public Wrapper<Boolean> checkActionCode(@ApiParam(name = "uacActionCheckCodeDto", value = "id与url") @RequestBody UacActionCheckCodeDto uacActionCheckCodeDto) {
    logger.info("校验权限编码唯一性 uacActionCheckCodeDto={}", uacActionCheckCodeDto);
    Long id = uacActionCheckCodeDto.getActionId();
    String actionCode = uacActionCheckCodeDto.getActionCode();
    Example example = new Example(UacAction.class);
    Example.Criteria criteria = example.createCriteria();
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    criteria.andEqualTo("actionCode", actionCode);
    int result = uacActionService.selectCountByExample(example);
    return WrapMapper.ok(result < 1);
}
Also used : Example(tk.mybatis.mapper.entity.Example) PostMapping(org.springframework.web.bind.annotation.PostMapping) ApiOperation(io.swagger.annotations.ApiOperation)

Example 7 with Example

use of tk.mybatis.mapper.entity.Example in project paascloud-master by paascloud.

the class UacActionCommonController method checkActionUrl.

/**
 * 检测权限URL唯一性
 *
 * @param uacActionCheckUrlDto the uac action check url dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkUrl")
@ApiOperation(httpMethod = "POST", value = "检测权限URL唯一性")
public Wrapper<Boolean> checkActionUrl(@ApiParam(name = "uacActionCheckUrlDto", value = "id与url") @RequestBody UacActionCheckUrlDto uacActionCheckUrlDto) {
    logger.info("检测权限URL唯一性 uacActionCheckUrlDto={}", uacActionCheckUrlDto);
    Long id = uacActionCheckUrlDto.getActionId();
    String url = uacActionCheckUrlDto.getUrl();
    Example example = new Example(UacAction.class);
    Example.Criteria criteria = example.createCriteria();
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    criteria.andEqualTo("url", url);
    int result = uacActionService.selectCountByExample(example);
    return WrapMapper.ok(result < 1);
}
Also used : Example(tk.mybatis.mapper.entity.Example) PostMapping(org.springframework.web.bind.annotation.PostMapping) ApiOperation(io.swagger.annotations.ApiOperation)

Example 8 with Example

use of tk.mybatis.mapper.entity.Example in project paascloud-master by paascloud.

the class UacGroupCommonController method checkGroupCode.

/**
 * 修改时验证组织编码
 *
 * @param checkGroupCodeDto the check group code dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkGroupCode")
@ApiOperation(httpMethod = "POST", value = "修改校验组织编码唯一性")
public Wrapper<Boolean> checkGroupCode(@ApiParam(name = "checkGroupCode", value = "组织相关信息") @RequestBody CheckGroupCodeDto checkGroupCodeDto) {
    logger.info("校验组织编码唯一性 checkGroupCodeDto={}", checkGroupCodeDto);
    Long id = checkGroupCodeDto.getGroupId();
    String groupCode = checkGroupCodeDto.getGroupCode();
    Example example = new Example(UacGroup.class);
    Example.Criteria criteria = example.createCriteria();
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    criteria.andEqualTo("groupCode", groupCode);
    int result = uacGroupService.selectCountByExample(example);
    return WrapMapper.ok(result < 1);
}
Also used : Example(tk.mybatis.mapper.entity.Example) ApiOperation(io.swagger.annotations.ApiOperation)

Example 9 with Example

use of tk.mybatis.mapper.entity.Example in project paascloud-master by paascloud.

the class UacGroupCommonController method checkGroupName.

/**
 * Check group name with edit wrapper.
 *
 * @param checkGroupNameDto the check group name dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkGroupName")
@ApiOperation(httpMethod = "POST", value = "编辑校验组织名唯一性")
public Wrapper<Boolean> checkGroupName(@ApiParam(name = "checkGroupName", value = "组织名称") @RequestBody CheckGroupNameDto checkGroupNameDto) {
    logger.info("校验组织名称唯一性 checkGroupNameDto={}", checkGroupNameDto);
    Long id = checkGroupNameDto.getGroupId();
    String groupName = checkGroupNameDto.getGroupName();
    Example example = new Example(UacGroup.class);
    Example.Criteria criteria = example.createCriteria();
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    criteria.andEqualTo("groupName", groupName);
    int result = uacGroupService.selectCountByExample(example);
    return WrapMapper.ok(result < 1);
}
Also used : Example(tk.mybatis.mapper.entity.Example) ApiOperation(io.swagger.annotations.ApiOperation)

Example 10 with Example

use of tk.mybatis.mapper.entity.Example in project paascloud-master by paascloud.

the class UacProductCategoryCommonController method checkCategoryName.

/**
 * 检测数据分类名称是否已存在.
 *
 * @param categoryCheckNameDto the category check name dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/checkCategoryName")
@ApiOperation(httpMethod = "POST", value = "检测数据分类名称是否已存在")
public Wrapper<Boolean> checkCategoryName(@RequestBody MdcCategoryCheckNameDto categoryCheckNameDto) {
    logger.info("检测数据分类名称是否已存在 categoryCheckNameDto={}", categoryCheckNameDto);
    Long id = categoryCheckNameDto.getCategoryId();
    String categoryName = categoryCheckNameDto.getCategoryName();
    Example example = new Example(MdcProductCategory.class);
    Example.Criteria criteria = example.createCriteria();
    if (id != null) {
        criteria.andNotEqualTo("id", id);
    }
    criteria.andEqualTo("name", categoryName);
    int result = mdcProductCategoryService.selectCountByExample(example);
    return WrapMapper.ok(result < 1);
}
Also used : Example(tk.mybatis.mapper.entity.Example) PostMapping(org.springframework.web.bind.annotation.PostMapping) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

Example (tk.mybatis.mapper.entity.Example)16 ApiOperation (io.swagger.annotations.ApiOperation)15 PostMapping (org.springframework.web.bind.annotation.PostMapping)8 MqMessageData (com.paascloud.provider.model.domain.MqMessageData)1 UacBizException (com.paascloud.provider.model.exceptions.UacBizException)1 Date (java.util.Date)1