条件类
package com.atguigu.springboot.vo; import lombok.Data; @Data public class CompanyCondition { private Integer id; /** * 单位名称 */ private String companyName; /** * 社会信用代码 */ private String socialCode; /** * 审核状态(0未审核,1审核中,2审核通过,3审核拒绝) */ private Integer isPublish; /** * 注册资金(两个文本框数据区间查询) * 最低注册资金 */ private Double registeredCapitalLow; /** * 最高注册资金 */ private Double registeredCapitalHigh; /** * 企业类型 */ private String character; /** * 联系人 */ private String contacts; /** * 联系电话 */ private String contactPhone; }
@ApiOperation(value = "根据组合条件查询企业信息", notes = "根据组合条件查询企业信息") @PostMapping("/list/condition/{page}/{size}") public ResponseBean getAdminInfoByCondition(@PathVariable("page") Integer page, @PathVariable("size") Integer size, @RequestBody CompanyCondition companyCondition) { PagecompanyPage = companyService.selectZuHe(new Page<>(page, size), companyCondition); return new ResponseBean(true,companyPage,ResponseEnums.SUCCESS_OPTION); }
service层
public interface CompanyService extends IService{ Page selectZuHe(Page page, CompanyCondition companyCondition); }
impl层
@Service public class CompanyServiceImpl extends ServiceImplimplements CompanyService { @Override public Page selectZuHe(Page page, CompanyCondition companyCondition) { return page.setRecords(this.baseMapper.selectZuHe(page, companyCondition)); } }
mapper层
package com.atguigu.springboot.mapper; import com.atguigu.springboot.entities.Company; import com.atguigu.springboot.vo.CompanyCondition; import com.baomidou.mybatisplus.mapper.BaseMapper; import com.baomidou.mybatisplus.plugins.Page; import org.apache.ibatis.annotations.Select; import java.util.List; /** ** Mapper 接口 *
* * @author gaobin * @since 2022-10-31 */ public interface CompanyMapper extends BaseMapper{ @Select("") List selectZuHe(Page page, CompanyCondition companyCondition); }