Commit ebaebb99 authored by lcl's avatar lcl

供应商

parent a6231c14
package com.dsk.cscec.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.cscec.domain.DCustomer;
import com.dsk.cscec.domain.bo.DCustomerSearchBo;
import com.dsk.cscec.service.IDCustomerService;
import com.dsk.system.domain.SysDept;
import com.dsk.system.domain.vo.SysDeptVo;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* 组织维表(DCustomer)表控制层
......@@ -14,14 +26,22 @@ import javax.annotation.Resource;
* @author lcl
* @since 2023-12-08 14:57:22
*/
@RequiredArgsConstructor
@RestController
@RequestMapping("/customer")
public class DCustomerController extends BaseController {
/**
* 服务对象
*/
@Resource
private IDCustomerService baseService;
private final IDCustomerService baseService;
/**
* 供应商总台账筛选
*/
@GetMapping("/all/searchList")
public TableDataInfo<DCustomer> allSearchList(DCustomerSearchBo bo, PageQuery query) {
return baseService.allSearchList(bo,query);
}
}
......
package com.dsk.cscec.domain.bo;
import lombok.Data;
/**
* @Author lcl
* @Data 2023/12/8 16:07
*/
@Data
public class DCustomerSearchBo {
/**
* 供应商名称
*/
private String customerName;
/**
* 区域
*/
private String[] region;
/**
* 省
*/
private String[] province;
/**
* 市
*/
private String[] city;
/**
* 供应商类别
*/
private String[] customerClass;
/**
* 供应商状态
*/
private String[] customerState;
/**
* 评价等级
*/
private String[] creditLevel;
/**
* 资质等级
*/
private String[] credential;
}
......@@ -2,7 +2,13 @@ package com.dsk.cscec.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsk.cscec.domain.DCustomer;
import com.dsk.cscec.domain.bo.DCustomerSearchBo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 组织维表(DCustomer)表数据库访问层
......@@ -12,5 +18,7 @@ import com.dsk.cscec.domain.DCustomer;
*/
public interface DCustomerMapper extends BaseMapper<DCustomer> {
Page<DCustomer> allSearchList(IPage<DCustomerSearchBo> build, @Param("bo") DCustomerSearchBo bo);
}
package com.dsk.cscec.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.cscec.domain.DCustomer;
import com.dsk.cscec.domain.bo.DCustomerSearchBo;
/**
* 组织维表(DCustomer)表服务接口
......@@ -11,5 +14,7 @@ import com.dsk.cscec.domain.DCustomer;
*/
public interface IDCustomerService extends IService<DCustomer> {
TableDataInfo<DCustomer> allSearchList(DCustomerSearchBo bo, PageQuery query);
}
package com.dsk.cscec.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.cscec.domain.bo.DCustomerSearchBo;
import com.dsk.cscec.mapper.DCustomerMapper;
import com.dsk.cscec.domain.DCustomer;
import com.dsk.cscec.service.IDCustomerService;
......@@ -15,5 +18,9 @@ import org.springframework.stereotype.Service;
@Service
public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer> implements IDCustomerService {
@Override
public TableDataInfo<DCustomer> allSearchList(DCustomerSearchBo bo, PageQuery query) {
return TableDataInfo.build(baseMapper.allSearchList(query.build(),bo));
}
}
......@@ -4,5 +4,15 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsk.cscec.mapper.DCustomerMapper">
<select id="allSearchList" resultType="com.dsk.cscec.domain.DCustomer">
select
customer_code, customer_name, recommend_org, register_region, register_province, register_city, customer_class, primary_business, paytax_type, tax_rate,
customer_state, leader_name, labor_captain_phone, labor_captain_idcard, service_team_personnum, service_team_speciality, construct_job_scope, credential,
register_capital, contact_person, contact_phone, approve_date2, credit_level
from d_customer
where recommend_org_id = 'F17305B4EA4444CBAB12892C7B99E475'
<if test="bo.customerName != null and bo.customerName != '' "> and customer_name like concat('%',#{bo.customerName},'%')</if>
order by approve_date2 desc
</select>
</mapper>
\ No newline at end of file
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