| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.jeecg.common.exception.ExceptionCast; |
| | | import org.jeecg.modules.tms.entity.ToolLedgerDetail; |
| | | import org.jeecg.modules.tms.mapper.ToolLedgerDetailMapper; |
| | | import org.jeecg.modules.tms.service.IToolLedgerDetailService; |
| | |
| | | } |
| | | return this.baseMapper.queryPageList(page, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> queryLendTool(Integer pageNo, Integer pageSize, Map<String, String> query) { |
| | | |
| | | if (pageNo == null || pageNo < 1 || pageSize == null || pageSize < 1) { |
| | | ExceptionCast.cast("参数错误"); |
| | | } |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | QueryWrapper<Map> queryWrapper = Wrappers.query(); |
| | | if (null != query) { |
| | | String toolCode = query.get("toolCode"); |
| | | if (StringUtils.isNotBlank(toolCode)) { |
| | | queryWrapper.like("p.tool_code", toolCode); |
| | | } |
| | | String status = query.get("status"); |
| | | if (StringUtils.isNotBlank(status)) { |
| | | queryWrapper.eq("t.status", status); |
| | | } |
| | | String classifyId = query.get("classifyId"); |
| | | if (StringUtils.isNotBlank(classifyId)) { |
| | | queryWrapper.like("p.classify_id", classifyId); |
| | | } |
| | | } |
| | | return this.baseMapper.queryLendTool(pageData,queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> querySharpenTool(Integer pageNo, Integer pageSize, Map<String, String> query) { |
| | | |
| | | if (pageNo == null || pageNo < 1 || pageSize == null || pageSize < 1) { |
| | | ExceptionCast.cast("参数错误"); |
| | | } |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | QueryWrapper<Map> queryWrapper = Wrappers.query(); |
| | | if (null != query) { |
| | | String toolCode = query.get("toolCode"); |
| | | if (StringUtils.isNotBlank(toolCode)) { |
| | | queryWrapper.like("p.tool_code", toolCode); |
| | | } |
| | | String status = query.get("status"); |
| | | if (StringUtils.isNotBlank(status)) { |
| | | queryWrapper.eq("t.status", status); |
| | | } |
| | | String classifyId = query.get("classifyId"); |
| | | if (StringUtils.isNotBlank(classifyId)) { |
| | | queryWrapper.like("p.classify_id", classifyId); |
| | | } |
| | | } |
| | | return this.baseMapper.querySharpenTool(pageData,queryWrapper); |
| | | } |
| | | } |