| | |
| | | import cn.iocoder.yudao.module.srm.controller.admin.supplier.vo.SrmSupplierPageReqVO; |
| | | import cn.iocoder.yudao.module.srm.dal.dataobject.SrmSupplierDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface SrmSupplierMapper extends BaseMapperX<SrmSupplierDO> { |
| | | |
| | | default PageResult<SrmSupplierDO> selectPage(SrmSupplierPageReqVO reqVO) { |
| | | LambdaQueryWrapperX<SrmSupplierDO> wrapper = new LambdaQueryWrapperX<SrmSupplierDO>() |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<SrmSupplierDO>() |
| | | .likeIfPresent(SrmSupplierDO::getCode, reqVO.getCode()) |
| | | .likeIfPresent(SrmSupplierDO::getName, reqVO.getName()) |
| | | .eqIfPresent(SrmSupplierDO::getType, reqVO.getType()) |
| | | .eqIfPresent(SrmSupplierDO::getStatus, reqVO.getStatus()) |
| | | .likeIfPresent(SrmSupplierDO::getContactName, reqVO.getContactName()) |
| | | .likeIfPresent(SrmSupplierDO::getContactMobile, reqVO.getContactMobile()) |
| | | .orderByDesc(SrmSupplierDO::getId); |
| | | if (Boolean.TRUE.equals(reqVO.getApproved())) { |
| | | wrapper.apply("id IN (SELECT supplier_id FROM srm_supplier_apply WHERE apply_status = 40 AND supplier_id IS NOT NULL AND deleted = 0)"); |
| | | } |
| | | return selectPage(reqVO, wrapper); |
| | | .orderByDesc(SrmSupplierDO::getId)); |
| | | } |
| | | |
| | | default SrmSupplierDO selectByCode(String code) { |
| | |
| | | default List<SrmSupplierDO> selectListByStatus(Integer status) { |
| | | return selectList(SrmSupplierDO::getStatus, status); |
| | | } |
| | | |
| | | @Select("SELECT DISTINCT s.* FROM srm_supplier s " + |
| | | "INNER JOIN srm_supplier_apply a ON a.supplier_id = s.id " + |
| | | "WHERE a.apply_status = 40 AND s.status = 0 AND s.deleted = 0") |
| | | List<SrmSupplierDO> selectApprovedList(); |
| | | |
| | | } |