fix: 原始单据分表出来
							parent
							
								
									90b9c4d168
								
							
						
					
					
						commit
						f4d932671d
					
				| @ -0,0 +1,15 @@ | |||||||
|  | package com.glxp.api.dao.collect; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||||
|  | import com.glxp.api.entity.collect.IoCollectOrderBizOrigin; | ||||||
|  | import com.glxp.api.req.collect.CollectOrderBizRequest; | ||||||
|  | import com.glxp.api.res.collect.CollectOrderBizResponse; | ||||||
|  | import org.apache.ibatis.annotations.Mapper; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Mapper | ||||||
|  | public interface IoCollectOrderBizOriginMapper extends BaseMapper<IoCollectOrderBizOrigin> { | ||||||
|  | 
 | ||||||
|  |     List<CollectOrderBizResponse> filterList(CollectOrderBizRequest collectOrderRequest); | ||||||
|  | } | ||||||
| @ -0,0 +1,15 @@ | |||||||
|  | package com.glxp.api.dao.collect; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||||
|  | import com.glxp.api.entity.collect.IoCollectOrderOrigin; | ||||||
|  | import com.glxp.api.req.collect.CollectOrderRequest; | ||||||
|  | import com.glxp.api.res.collect.IoCollectOrderResponse; | ||||||
|  | import org.apache.ibatis.annotations.Mapper; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Mapper | ||||||
|  | public interface IoCollectOrderOriginMapper extends BaseMapper<IoCollectOrderOrigin> { | ||||||
|  | 
 | ||||||
|  |     List<IoCollectOrderResponse> filterList(CollectOrderRequest collectOrderRequest); | ||||||
|  | } | ||||||
| @ -0,0 +1,32 @@ | |||||||
|  | package com.glxp.api.service.collect; | ||||||
|  | 
 | ||||||
|  | import com.github.pagehelper.PageHelper; | ||||||
|  | import com.glxp.api.req.collect.CollectOrderBizRequest; | ||||||
|  | import com.glxp.api.res.collect.CollectOrderBizResponse; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | import javax.annotation.Resource; | ||||||
|  | import java.util.Collections; | ||||||
|  | import java.util.List; | ||||||
|  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||||
|  | import com.glxp.api.entity.collect.IoCollectOrderBizOrigin; | ||||||
|  | import com.glxp.api.dao.collect.IoCollectOrderBizOriginMapper; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | @Service | ||||||
|  | public class IoCollectOrderBizOriginService extends ServiceImpl<IoCollectOrderBizOriginMapper, IoCollectOrderBizOrigin> { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     public List<CollectOrderBizResponse> filterList(CollectOrderBizRequest collectOrderRequest) { | ||||||
|  |         if (collectOrderRequest == null) { | ||||||
|  |             return Collections.emptyList(); | ||||||
|  |         } | ||||||
|  |         if (collectOrderRequest.getPage() != null) { | ||||||
|  |             int offset = (collectOrderRequest.getPage() - 1) * collectOrderRequest.getLimit(); | ||||||
|  |             PageHelper.offsetPage(offset, collectOrderRequest.getLimit()); | ||||||
|  |         } | ||||||
|  |         List<CollectOrderBizResponse> data = this.baseMapper.filterList(collectOrderRequest); | ||||||
|  |         return data; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,35 @@ | |||||||
|  | package com.glxp.api.service.collect; | ||||||
|  | 
 | ||||||
|  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||||
|  | import com.github.pagehelper.PageHelper; | ||||||
|  | import com.glxp.api.entity.collect.IoCollectOrder; | ||||||
|  | import com.glxp.api.req.collect.CollectOrderRequest; | ||||||
|  | import com.glxp.api.res.collect.IoCollectOrderResponse; | ||||||
|  | import org.springframework.stereotype.Service; | ||||||
|  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||||
|  | import com.glxp.api.entity.collect.IoCollectOrderOrigin; | ||||||
|  | import com.glxp.api.dao.collect.IoCollectOrderOriginMapper; | ||||||
|  | 
 | ||||||
|  | import java.util.Collections; | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | @Service | ||||||
|  | public class IoCollectOrderOriginService extends ServiceImpl<IoCollectOrderOriginMapper, IoCollectOrderOrigin> { | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     public List<IoCollectOrderResponse> filterList(CollectOrderRequest collectOrderRequest) { | ||||||
|  |         if (collectOrderRequest == null) { | ||||||
|  |             return Collections.emptyList(); | ||||||
|  |         } | ||||||
|  |         if (collectOrderRequest.getPage() != null) { | ||||||
|  |             int offset = (collectOrderRequest.getPage() - 1) * collectOrderRequest.getLimit(); | ||||||
|  |             PageHelper.offsetPage(offset, collectOrderRequest.getLimit()); | ||||||
|  |         } | ||||||
|  |         List<IoCollectOrderResponse> data = this.baseMapper.filterList(collectOrderRequest); | ||||||
|  |         return data; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public IoCollectOrderOrigin getByBillNo(String billNo) { | ||||||
|  |         return this.baseMapper.selectOne(new LambdaQueryWrapper<IoCollectOrderOrigin>().eq(IoCollectOrderOrigin::getBillNo, billNo).last("limit 1")); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,42 @@ | |||||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||||
|  | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||||
|  | <mapper namespace="com.glxp.api.dao.collect.IoCollectOrderBizOriginMapper"> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |   <select id="filterList" parameterType="com.glxp.api.req.collect.CollectOrderBizRequest" | ||||||
|  |             resultType="com.glxp.api.res.collect.CollectOrderBizResponse"> | ||||||
|  |         SELECT icob.*, | ||||||
|  |                bp.nameCode                   diCode, | ||||||
|  |                bp.zczbhhzbapzbh, | ||||||
|  |                bp.manufactory, | ||||||
|  |                bp.bzgg | ||||||
|  |         FROM io_collect_order_biz_origin icob | ||||||
|  |                  left join basic_udirel bu on icob.relId = bu.id | ||||||
|  |                  left join basic_products bp on bu.uuid = bp.uuid | ||||||
|  |         <where> | ||||||
|  |             <if test="thrCode != '' and thrCode != null"> | ||||||
|  |                 AND icob.thrCode LIKE concat('%', #{thrCode}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="orderIdFk != null and orderIdFk != ''"> | ||||||
|  |                 AND icob.orderIdFk = #{orderIdFk} | ||||||
|  |             </if> | ||||||
|  |             <if test="relId != null"> | ||||||
|  |                 AND icob.relId = #{relId} | ||||||
|  |             </if> | ||||||
|  |             <if test="cpmctymc != null and cpmctymc != ''"> | ||||||
|  |                 AND icob.cpmctymc LIKE concat('%', #{cpmctymc}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="unionCode != '' and unionCode != null"> | ||||||
|  |                 and ( | ||||||
|  |                         bp.nameCode LIKE concat('%', #{unionCode}, '%') | ||||||
|  |                         or bp.ybbm LIKE concat('%', #{unionCode}, '%') | ||||||
|  |                         or bp.sptm LIKE concat('%', #{unionCode}, '%')) | ||||||
|  |             </if> | ||||||
|  |             <if test="ggxh != '' and ggxh != null"> | ||||||
|  |                 AND ggxh LIKE concat('%', #{ggxh}, '%') | ||||||
|  |             </if> | ||||||
|  |         </where> | ||||||
|  |         group by icob.id | ||||||
|  |     </select> | ||||||
|  | 
 | ||||||
|  | </mapper> | ||||||
| @ -0,0 +1,112 @@ | |||||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||||
|  | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||||
|  | <mapper namespace="com.glxp.api.dao.collect.IoCollectOrderOriginMapper"> | ||||||
|  | 
 | ||||||
|  |  <select id="filterList" parameterType="com.glxp.api.req.collect.CollectOrderRequest" | ||||||
|  |             resultType="com.glxp.api.res.collect.IoCollectOrderResponse"> | ||||||
|  |         SELECT ico.billNo, | ||||||
|  |                ico.busType, | ||||||
|  |                ico.fromType, | ||||||
|  |                ico.fromTypeDesc, | ||||||
|  |                ico.fromCorp, | ||||||
|  |                ico.billTime, | ||||||
|  |                ico.orderCirType, | ||||||
|  |                ico.createTime, | ||||||
|  |                ico.workPlaceCode, | ||||||
|  |                ico.remark, | ||||||
|  |                ico.createUser, | ||||||
|  |                ico.updateTime, | ||||||
|  |                ico.updateUser, | ||||||
|  |                ico.tagStatus, | ||||||
|  |                ico.splitStatus, | ||||||
|  |                ico.invAlert, | ||||||
|  |                ico.splitMsg, | ||||||
|  |                ico.fromCorpName, | ||||||
|  |                ico.tagMsg, | ||||||
|  |                sys_workplace_document.busName                       busTypeName, | ||||||
|  |                sw.workplaceName, | ||||||
|  |                ico.id, | ||||||
|  |                ico.orderTime, | ||||||
|  |                ico.uploadStatus, | ||||||
|  |                ico.uploadError, | ||||||
|  |                ico.errorMsg, | ||||||
|  |                row_number() over ( order by case when ico.orderTime is null then ico.createTime else ico.orderTime end desc ) as orderSequence | ||||||
|  |         FROM io_collect_order_origin ico | ||||||
|  |                  left join sys_workplace_document on ico.busType = sys_workplace_document.documentTypeCode | ||||||
|  |                  left join basic_corp bc on ico.fromCorp = bc.erpId | ||||||
|  |                  left join sys_workplace sw on ico.workPlaceCode = sw.workplaceId | ||||||
|  |         <where> | ||||||
|  |             <if test="billNo != '' and billNo != null"> | ||||||
|  |                 AND billNo LIKE concat('%', #{billNo}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="workplaceName != '' and workplaceName != null"> | ||||||
|  |                 AND workplaceName LIKE concat('%', #{workplaceName}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="busType != null and busType != ''"> | ||||||
|  |                 AND busType = #{busType} | ||||||
|  |             </if> | ||||||
|  |             <if test="fromCorp != '' and fromCorp != null"> | ||||||
|  |                 AND fromCorp LIKE concat('%', #{fromCorp}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="collectCode != null and collectCode != ''"> | ||||||
|  |                 AND collectCode = #{collectCode} | ||||||
|  |             </if> | ||||||
|  |             <if test="busType != null and busType != ''"> | ||||||
|  |                 AND busType = #{busType} | ||||||
|  |             </if> | ||||||
|  |             <if test="tagStatus != null"> | ||||||
|  |                 AND tagStatus = #{tagStatus} | ||||||
|  |             </if> | ||||||
|  |             <if test="workPlaceCode != null"> | ||||||
|  |                 AND ico.workPlaceCode = #{workPlaceCode} | ||||||
|  |             </if> | ||||||
|  |             <if test="chargeUser != null"> | ||||||
|  |                 AND sw.chargeUser = #{chargeUser} | ||||||
|  |             </if> | ||||||
|  |             <if test="unionKey != null"> | ||||||
|  |                 AND ( | ||||||
|  |                         ico.billNo like concat('%', #{unionKey}, '%') | ||||||
|  |                         or ico.fromCorp like concat('%', #{unionKey}, '%') | ||||||
|  |                         or ico.fromCorpName like concat('%', #{unionKey}, '%') | ||||||
|  |                         or ico.backupOrderRemark1 like concat('%', #{unionKey}, '%') | ||||||
|  |                         or ico.backupOrderRemark2 like concat('%', #{unionKey}, '%') | ||||||
|  |                         or ico.backupOrderRemark3 like concat('%', #{unionKey}, '%') | ||||||
|  |                         or ico.backupOrderRemark4 like concat('%', #{unionKey}, '%') | ||||||
|  |                         or ico.backupOrderRemark5 like concat('%', #{unionKey}, '%') | ||||||
|  |                         or ico.backupOrderRemark6 like concat('%', #{unionKey}, '%')) | ||||||
|  |             </if> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |             <if test="tagStatusList != null and tagStatusList.size() > 0"> | ||||||
|  |                 and tagStatus in | ||||||
|  |                 <foreach collection="tagStatusList" item="item" index="index" separator="," open="(" close=")"> | ||||||
|  |                     #{item} | ||||||
|  |                 </foreach> | ||||||
|  |             </if> | ||||||
|  |             <if test="workPlaceCodes != null and workPlaceCodes.size() > 0"> | ||||||
|  |                 and ico.workPlaceCode in | ||||||
|  |                 <foreach collection="workPlaceCodes" item="item" index="index" separator="," open="(" close=")"> | ||||||
|  |                     #{item} | ||||||
|  |                 </foreach> | ||||||
|  |             </if> | ||||||
|  |             <if test="invAlert != null"> | ||||||
|  |                 and ico.invAlert =#{invAlert} | ||||||
|  |             </if> | ||||||
|  |             <if test="invAlerts != null and invAlerts.size() > 0"> | ||||||
|  |                 and ico.invAlert in | ||||||
|  |                 <foreach collection="invAlerts" item="item" index="index" separator="," open="(" close=")"> | ||||||
|  |                     #{item} | ||||||
|  |                 </foreach> | ||||||
|  |             </if> | ||||||
|  |             <if test="uploadStatus != null"> | ||||||
|  |                 and ico.uploadStatus = #{uploadStatus} | ||||||
|  |             </if> | ||||||
|  |         </where> | ||||||
|  |         GROUP BY | ||||||
|  |         ico.billNo | ||||||
|  |         order by case when ico.orderTime is null then ico.createTime else ico.orderTime end desc | ||||||
|  |     </select> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | </mapper> | ||||||
					Loading…
					
					
				
		Reference in New Issue