Merge remote-tracking branch 'origin/master'
						commit
						3f5bdcaade
					
				| @ -1,23 +0,0 @@ | ||||
| package com.glxp.api.dao.basic; | ||||
| 
 | ||||
| import com.glxp.api.dao.BaseMapperPlus; | ||||
| import com.glxp.api.entity.basic.BasicProductsEntity; | ||||
| import com.glxp.api.entity.basic.CompanyProductRelevanceEntity; | ||||
| import com.glxp.api.req.basic.CompanyProductRelevanceRequest; | ||||
| import com.glxp.api.res.basic.CompanyProductRelevanceResponse; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Mapper | ||||
| public interface CompanyProductRelevanceDao extends BaseMapperPlus<CompanyProductRelevanceDao, CompanyProductRelevanceEntity, CompanyProductRelevanceEntity> { | ||||
|     List<CompanyProductRelevanceResponse> filterUdiGp(CompanyProductRelevanceRequest basicInstrumentMaintainRequest); | ||||
| 
 | ||||
|     boolean insertCompanyProductRelevance(CompanyProductRelevanceEntity companyCertEntity); | ||||
| 
 | ||||
|     boolean importCompanyProductRelevance(CompanyProductRelevanceEntity companyProductRelevanceEntity); | ||||
| 
 | ||||
|     boolean deleteById(String id); | ||||
| 
 | ||||
|     boolean deleteByRlId(String id); | ||||
| } | ||||
| @ -1,87 +0,0 @@ | ||||
| package com.glxp.api.dao.basic; | ||||
| 
 | ||||
| import com.glxp.api.entity.basic.UdiProductEntity; | ||||
| import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||
| import com.glxp.api.req.basic.UdiInfoRequest; | ||||
| import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Mapper | ||||
| public interface UdiProductDao { | ||||
| 
 | ||||
|     List<UdiProductEntity> filterUdiInfo(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     UdiProductEntity findByNameCode(@Param("nameCode") String nameCode); | ||||
| 
 | ||||
|     UdiProductEntity findByUuid(@Param("uuid") String uuid); | ||||
| 
 | ||||
|     List<UdiProductEntity> findByUuids(@Param("uuid") String uuid); | ||||
| 
 | ||||
|     UdiProductEntity findById(@Param("id") String id); | ||||
| 
 | ||||
|     boolean insertUdiInfo(UdiProductEntity udiProductEntity); | ||||
| 
 | ||||
|     boolean insertUdiInfos(@Param("udiInfoEntities") List<UdiProductEntity> udiInfoEntities); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据nameCode更新产品信息 | ||||
|      */ | ||||
|     boolean updateUdiInfo(UdiProductEntity udiProductEntity); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据UUID更新产品信息 | ||||
|      */ | ||||
|     boolean updateUdiInfoByUuid(UdiProductEntity udiProductEntity); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据ID更新产品信息 | ||||
|      */ | ||||
|     boolean updateUdiInfoById(UdiProductEntity udiProductEntity); | ||||
| 
 | ||||
|     boolean deleteById(@Param("id") String id); | ||||
| 
 | ||||
|     boolean deleteByUuid(@Param("uuid") String uuid); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据UUID批量查询数据 | ||||
|      */ | ||||
|     List<UdiProductEntity> batchSelectByUuid(@Param("uuids") List<String> uuids); | ||||
| 
 | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 导入医疗器械信息 | ||||
|      */ | ||||
|     void importUdiInfo(@Param("udiInfoEntities") List<UdiProductEntity> udiInfoEntities); | ||||
| 
 | ||||
|     /** | ||||
|      * 查询包装层级 | ||||
|      * | ||||
|      * @param nameCode | ||||
|      * @return | ||||
|      */ | ||||
|     Integer selectPackLevel(@Param("nameCode") String nameCode); | ||||
| 
 | ||||
|     /** | ||||
|      * 查询产品规格型号列表 | ||||
|      * | ||||
|      * @param relId | ||||
|      * @return | ||||
|      */ | ||||
|     List<String> selectGgxhList(@Param("relId") String relId); | ||||
| 
 | ||||
|     boolean updateUdiInfoNotAll(UdiInfoRequest udiInfoRequest); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据DI查询此产品是否允许无批次号参数 | ||||
|      * | ||||
|      * @param nameCode | ||||
|      * @return | ||||
|      */ | ||||
|     UdiProductEntity selectAllowNoBatch(@Param("nameCode") String nameCode); | ||||
| } | ||||
| @ -1,121 +0,0 @@ | ||||
| package com.glxp.api.dao.basic; | ||||
| 
 | ||||
| import com.glxp.api.dao.BaseMapperPlus; | ||||
| import com.glxp.api.entity.basic.UdiRelevanceEntity; | ||||
| import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||
| import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Mapper | ||||
| public interface UdiRelevanceDao extends BaseMapperPlus<UdiRelevanceDao, UdiRelevanceEntity, UdiRelevanceEntity> { | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> filterUdiRelevance(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> filterUdiJoinSup(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> filterCertUdi(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> filterUdiGp(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     //    UdiRelevanceResponse selectUdiByUUid
 | ||||
|     List<UdiRelevanceEntity> selectByUuid(@Param("uuid") String uuid); | ||||
| 
 | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> contrastJoinSelect(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
| 
 | ||||
|     UdiRelevanceEntity selectById(@Param("id") Long id); | ||||
| 
 | ||||
|     UdiRelevanceEntity selectByThirdId(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     List<UdiRelevanceEntity> filterEntity(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
| 
 | ||||
|     boolean insertUdiRelevance(UdiRelevanceEntity udiRelevanceEntity); | ||||
| 
 | ||||
|     boolean insertUdiRelevanceignore(UdiRelevanceEntity udiRelevanceEntity); | ||||
| 
 | ||||
|     boolean updateUdiRelevance(UdiRelevanceEntity udiRelevanceEntity); | ||||
| 
 | ||||
|     boolean deleteById(@Param("id") String id); | ||||
| 
 | ||||
|     boolean deleteByIds(@Param("ids") List<String> id); | ||||
| 
 | ||||
|     boolean deleteByUuid(@Param("uuid") String uuid); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据UUID批量查询信息 | ||||
|      * | ||||
|      * @param uuids | ||||
|      * @return | ||||
|      */ | ||||
|     List<UdiRelevanceEntity> batchSelectByUuid(@Param("uuids") List<String> uuids); | ||||
| 
 | ||||
| 
 | ||||
|     List<UdiRelevanceEntity> batchSelectByIds(@Param("ids") List<String> ids); | ||||
| 
 | ||||
|     /** | ||||
|      * 批量导入数据 | ||||
|      * | ||||
|      * @param udiRelevanceEntities | ||||
|      */ | ||||
|     void importUdiRelevance(@Param("udiRelevanceEntities") List<UdiRelevanceEntity> udiRelevanceEntities); | ||||
| 
 | ||||
|     /** | ||||
|      * /** | ||||
|      * 查找产品UUID | ||||
|      * | ||||
|      * @param relId | ||||
|      * @return | ||||
|      */ | ||||
|     String selectUuidById(@Param("relId") String relId); | ||||
| 
 | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> selectGroupByNameCode(@Param("nameCode") String nameCode, @Param("isDisable") Boolean isDisable); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据耗材字典ID查询产品名称 | ||||
|      * | ||||
|      * @param relId | ||||
|      * @return | ||||
|      */ | ||||
|     String selectProductNameByRelId(@Param("relId") Long relId); | ||||
| 
 | ||||
|     /** | ||||
|      * 查询预警参数 | ||||
|      * | ||||
|      * @param relId | ||||
|      * @return | ||||
|      */ | ||||
|     UdiRelevanceEntity selectRemindParams(@Param("relId") Long relId); | ||||
| 
 | ||||
|     Boolean updateBatchById(@Param("list") List<UdiRelevanceEntity> list); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据院内分类编码查询 | ||||
|      * | ||||
|      * @param relCode | ||||
|      * @return | ||||
|      */ | ||||
|     Long selectProductByRelCode(@Param("relCode") String relCode); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据DI查找此产品的id | ||||
|      * | ||||
|      * @param nameCode | ||||
|      * @return | ||||
|      */ | ||||
|     String selectRelIdByNameCode(@Param("nameCode") String nameCode); | ||||
| 
 | ||||
|     /** | ||||
|      * 查询一条产品信息数据 | ||||
|      * | ||||
|      * @param filterUdiRelRequest | ||||
|      * @return | ||||
|      */ | ||||
|     UdiRelevanceResponse selectOneUdiJoinSup(FilterUdiRelRequest filterUdiRelRequest); | ||||
| } | ||||
| @ -1,54 +0,0 @@ | ||||
| package com.glxp.api.dao.basic; | ||||
| 
 | ||||
| import com.glxp.api.dao.BaseMapperPlus; | ||||
| import com.glxp.api.entity.basic.UdiRlSupEntity; | ||||
| import com.glxp.api.req.basic.CompanyProductRelevanceRequest; | ||||
| import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest; | ||||
| import com.glxp.api.res.basic.UdiRlSupResponse; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Mapper | ||||
| public interface UdiRlSupDao extends BaseMapperPlus<UdiRlSupDao, UdiRlSupEntity, UdiRlSupEntity> { | ||||
| 
 | ||||
|     List<UdiRlSupResponse> filterUdiGp(CompanyProductRelevanceRequest basicInstrumentMaintainRequest); | ||||
| 
 | ||||
|     List<UdiRlSupEntity> filterCompanyProductRelevance(FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest); | ||||
| 
 | ||||
|     UdiRlSupEntity findCompanyProductRelevance(String CustomerId); | ||||
| 
 | ||||
|     UdiRlSupEntity findCompanyProductRelevanceByProductId(String productId); | ||||
| 
 | ||||
|     UdiRlSupEntity findCompanyProductRelevanceByUdiRlIdFk(@Param("udiRlIdFk") String udiRlIdFk, @Param("customerId") String customerId); | ||||
| 
 | ||||
|     UdiRlSupEntity findCompanyProductRelevanceByProductUuid(UdiRlSupEntity udiRlSupEntity); | ||||
| 
 | ||||
|     List<UdiRlSupEntity> getCompanyProductRelevance(FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest); | ||||
| 
 | ||||
| 
 | ||||
|     boolean insertCompanyProductRelevance(UdiRlSupEntity companyCertEntity); | ||||
| 
 | ||||
|     boolean importCompanyProductRelevance(UdiRlSupEntity udiRlSupEntity); | ||||
| 
 | ||||
|     boolean deleteById(String id); | ||||
| 
 | ||||
|     boolean deleteByRlId(String id); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据耗材ID查询供应商ID列表 | ||||
|      * | ||||
|      * @param relId | ||||
|      * @return | ||||
|      */ | ||||
|     List<String> selectUnitFkByRelId(@Param("relId") Long relId); | ||||
| 
 | ||||
|     /** | ||||
|      * 统计供应商配送产品数量 | ||||
|      * | ||||
|      * @param companyProductRelevanceRequest | ||||
|      * @return | ||||
|      */ | ||||
|     Long selectSupRlCount(CompanyProductRelevanceRequest companyProductRelevanceRequest); | ||||
| } | ||||
| @ -1,22 +0,0 @@ | ||||
| package com.glxp.api.service.basic; | ||||
| 
 | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import com.glxp.api.entity.basic.CompanyProductRelevanceEntity; | ||||
| import com.glxp.api.req.basic.CompanyProductRelevanceRequest; | ||||
| import com.glxp.api.res.basic.CompanyProductRelevanceResponse; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| public interface CompanyProductRelevanceService extends IService<CompanyProductRelevanceEntity> { | ||||
| 
 | ||||
|     List<CompanyProductRelevanceResponse> filterUdiGp(CompanyProductRelevanceRequest basicInstrumentMaintainRequest); | ||||
| 
 | ||||
|     boolean insertCompanyProductRelevance(CompanyProductRelevanceEntity companyCertEntity); | ||||
| 
 | ||||
|     boolean deleteById(String id); | ||||
| 
 | ||||
|     boolean deleteByRlId(String id); | ||||
| 
 | ||||
|     boolean isExitByRelId(String relId); | ||||
| } | ||||
| @ -1,63 +0,0 @@ | ||||
| package com.glxp.api.service.basic; | ||||
| 
 | ||||
| import com.glxp.api.entity.basic.UdiProductEntity; | ||||
| import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||
| import com.glxp.api.req.basic.UdiInfoRequest; | ||||
| import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 耗材字典-字典信息 | ||||
|  */ | ||||
| public interface UdiProductService { | ||||
| 
 | ||||
|     List<UdiProductEntity> filterUdiInfo(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     UdiProductEntity findBySptm(String sptm); | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     List<UdiProductEntity> filterAllUdiInfo(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     UdiProductEntity findByNameCode(String nameCode); | ||||
| 
 | ||||
|     UdiProductEntity findById(@Param("id") String id); | ||||
| 
 | ||||
|     UdiProductEntity findByUuid(String uuid); | ||||
| 
 | ||||
|     List<UdiProductEntity> findByUuids(String uuid); | ||||
| 
 | ||||
|     boolean insertUdiInfo(UdiProductEntity udiProductEntity); | ||||
| 
 | ||||
|     boolean insertUdiInfos(List<UdiProductEntity> udiInfoEntities); | ||||
| 
 | ||||
|     boolean updateUdiInfo(UdiProductEntity udiProductEntity); | ||||
| 
 | ||||
|     boolean updateUdiInfoByUuid(UdiProductEntity udiProductEntity); | ||||
| 
 | ||||
|     boolean updateUdiInfoById(UdiProductEntity udiProductEntity); | ||||
| 
 | ||||
|     boolean deleteById(String id); | ||||
| 
 | ||||
|     boolean deleteByUuid(String uuid); | ||||
| 
 | ||||
|     /** | ||||
|      * 查询产品规格型号列表 | ||||
|      * | ||||
|      * @param relId | ||||
|      * @return | ||||
|      */ | ||||
|     List<String> getGgxhList(String relId); | ||||
| 
 | ||||
|     boolean updateUdiInfoNotAll(UdiInfoRequest udiInfoRequest); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据DI查询此产品是否允许无批次号 | ||||
|      * | ||||
|      * @param nameCode | ||||
|      * @return | ||||
|      */ | ||||
|     UdiProductEntity getAllowNoBatch(String nameCode); | ||||
| } | ||||
| @ -1,105 +0,0 @@ | ||||
| package com.glxp.api.service.basic; | ||||
| 
 | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import com.glxp.api.entity.basic.UdiRelevanceEntity; | ||||
| import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||
| import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 耗材字典关联 | ||||
|  */ | ||||
| public interface UdiRelevanceService extends IService<UdiRelevanceEntity> { | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> filterUdiRelevance(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> filterCertUdi(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> filterUdiJoinSup(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     List<UdiRelevanceEntity> filterUdiEntity(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     UdiRelevanceResponse selectByNameCode(String nameCode); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据耗材字典ID查询耗材相关数据 | ||||
|      * | ||||
|      * @param relId | ||||
|      * @return | ||||
|      */ | ||||
|     UdiRelevanceResponse selectByRelId(String relId); | ||||
| 
 | ||||
|     //根据DI查询产品信息
 | ||||
|     List<UdiRelevanceResponse> selectAllByNameCode(String nameCode); | ||||
| 
 | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> selectAllByNameCode(String nameCode, String unitFk); | ||||
| 
 | ||||
|     boolean isExit(); | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> filterUdiGp(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     boolean isExitByUuid(String uuid); | ||||
| 
 | ||||
|     List<UdiRelevanceEntity> batchSelectByUuid(List<String> uuids); | ||||
| 
 | ||||
|     List<UdiRelevanceEntity> batchSelectByIds(List<String> ids); | ||||
| 
 | ||||
|     List<UdiRelevanceEntity> selectByUuid(String uuid); | ||||
| 
 | ||||
|     UdiRelevanceEntity selectById(Long id); | ||||
| 
 | ||||
|     UdiRelevanceResponse selectGroupById(Long id); | ||||
| 
 | ||||
|     UdiRelevanceResponse selectUdiId(Long id); | ||||
| 
 | ||||
| 
 | ||||
|     UdiRelevanceResponse selectSupGroupById(Long id, String supId); | ||||
| 
 | ||||
| 
 | ||||
|     UdiRelevanceEntity selectUpdateByUuid(String uuid); | ||||
| 
 | ||||
|     UdiRelevanceEntity selectUpdateByThirdId(String thirdId); | ||||
| 
 | ||||
|     UdiRelevanceEntity selectByMainIdLimitOne(String mainId); | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> selectByMainId(String mainId); | ||||
| 
 | ||||
|     UdiRelevanceEntity selectUpteaByAll(String uuid, String thirdId); | ||||
| 
 | ||||
|     UdiRelevanceEntity selectByThirdId(String thirdId, String thirdSys); | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> selectListByThirdId(String thirdId, String thirdSys); | ||||
| 
 | ||||
|     boolean insertUdiRelevance(UdiRelevanceEntity udiRelevanceEntity); | ||||
| 
 | ||||
|     boolean insertUdiRelevanceignore(UdiRelevanceEntity udiRelevanceEntity); | ||||
| 
 | ||||
|     boolean updateUdiRelevance(UdiRelevanceEntity udiRelevanceEntity); | ||||
| 
 | ||||
|     boolean deleteById(String id); | ||||
| 
 | ||||
|     boolean deleteByIds(List<String> id); | ||||
| 
 | ||||
|     boolean deleteByUuid(String uuid); | ||||
| 
 | ||||
|     /** | ||||
|      * 查询产品的uuid | ||||
|      * | ||||
|      * @param relId | ||||
|      * @return | ||||
|      */ | ||||
|     String findUuidById(String relId); | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> selectGroupByNameCode(String nameCode, Boolean isDisable); | ||||
| 
 | ||||
|     /** | ||||
|      * 根据UDI码查询耗材字典ID | ||||
|      * | ||||
|      * @param code | ||||
|      * @return | ||||
|      */ | ||||
|     String getRelIdByUdiCode(String code); | ||||
| } | ||||
| @ -1,62 +0,0 @@ | ||||
| package com.glxp.api.service.basic.impl; | ||||
| 
 | ||||
| 
 | ||||
| import cn.hutool.core.util.IdUtil; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.dao.basic.CompanyProductRelevanceDao; | ||||
| import com.glxp.api.entity.basic.CompanyProductRelevanceEntity; | ||||
| import com.glxp.api.req.basic.CompanyProductRelevanceRequest; | ||||
| import com.glxp.api.res.basic.CompanyProductRelevanceResponse; | ||||
| import com.glxp.api.service.basic.CompanyProductRelevanceService; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| @Transactional(rollbackFor = Exception.class) | ||||
| public class CompanyProductRelevanceServiceImpl extends ServiceImpl<CompanyProductRelevanceDao, CompanyProductRelevanceEntity> | ||||
|         implements CompanyProductRelevanceService { | ||||
|     @Resource | ||||
|     CompanyProductRelevanceDao companyProductRelevanceDao; | ||||
| 
 | ||||
|     @Override | ||||
|     public List<CompanyProductRelevanceResponse> filterUdiGp(CompanyProductRelevanceRequest basicInstrumentMaintainRequest) { | ||||
|         if (basicInstrumentMaintainRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (basicInstrumentMaintainRequest.getPage() != null) { | ||||
|             int offset = (basicInstrumentMaintainRequest.getPage() - 1) * basicInstrumentMaintainRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, basicInstrumentMaintainRequest.getLimit()); | ||||
|         } | ||||
| 
 | ||||
|         List<CompanyProductRelevanceResponse> data = companyProductRelevanceDao.filterUdiGp(basicInstrumentMaintainRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean insertCompanyProductRelevance(CompanyProductRelevanceEntity companyProductRelevanceEntity) { | ||||
|         if (companyProductRelevanceEntity.getId() == null) | ||||
|             companyProductRelevanceEntity.setId(IdUtil.getSnowflakeNextId()); | ||||
|         return companyProductRelevanceDao.insertCompanyProductRelevance(companyProductRelevanceEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteById(String id) { | ||||
|         return companyProductRelevanceDao.deleteById(id); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteByRlId(String id) { | ||||
|         return companyProductRelevanceDao.deleteByRlId(id); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean isExitByRelId(String relId) { | ||||
|         return companyProductRelevanceDao.exists(new QueryWrapper<CompanyProductRelevanceEntity>().eq("udiRlIdFk", relId)); | ||||
|     } | ||||
| } | ||||
| @ -1,158 +0,0 @@ | ||||
| package com.glxp.api.service.basic.impl; | ||||
| 
 | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import cn.hutool.core.util.IdUtil; | ||||
| import cn.hutool.core.util.StrUtil; | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.dao.basic.UdiProductDao; | ||||
| import com.glxp.api.entity.basic.UdiProductEntity; | ||||
| import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||
| import com.glxp.api.req.basic.UdiInfoRequest; | ||||
| import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||
| import com.glxp.api.service.basic.UdiProductService; | ||||
| import com.glxp.api.util.udi.FilterUdiUtils; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| @Transactional(rollbackFor = Exception.class) | ||||
| public class UdiProductServiceImpl implements UdiProductService { | ||||
| 
 | ||||
|     @Resource | ||||
|     UdiProductDao udiProductDao; | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiProductEntity> filterUdiInfo(FilterUdiRelRequest filterUdiRelRequest) { | ||||
|         if (filterUdiRelRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (filterUdiRelRequest.getPage() != null) { | ||||
|             int offset = (filterUdiRelRequest.getPage() - 1) * filterUdiRelRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, filterUdiRelRequest.getLimit()); | ||||
|         } | ||||
| 
 | ||||
|         List<UdiProductEntity> data = udiProductDao.filterUdiInfo(filterUdiRelRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiProductEntity findBySptm(String sptm) { | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         filterUdiRelRequest.setSptm(sptm); | ||||
|         List<UdiProductEntity> data = udiProductDao.filterUdiInfo(filterUdiRelRequest); | ||||
|         if (CollUtil.isNotEmpty(data)) { | ||||
|             return data.get(0); | ||||
|         } | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiRelRequest filterUdiRelRequest) { | ||||
|         if (filterUdiRelRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (filterUdiRelRequest.getPage() != null) { | ||||
|             int offset = (filterUdiRelRequest.getPage() - 1) * filterUdiRelRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, filterUdiRelRequest.getLimit()); | ||||
|         } | ||||
| 
 | ||||
|         List<UdiRelevanceResponse> data = udiProductDao.filterUdiInfo2(filterUdiRelRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiProductEntity> filterAllUdiInfo(FilterUdiRelRequest filterUdiRelRequest) { | ||||
|         if (filterUdiRelRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         List<UdiProductEntity> data = udiProductDao.filterUdiInfo(filterUdiRelRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiProductEntity findByNameCode(String nameCode) { | ||||
|         String prefix = FilterUdiUtils.getDiStr(nameCode); | ||||
|         return udiProductDao.findByNameCode(prefix); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiProductEntity findById(String id) { | ||||
|         return udiProductDao.findById(id); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiProductEntity findByUuid(String uuid) { | ||||
|         return udiProductDao.findByUuid(uuid); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiProductEntity> findByUuids(String uuid) { | ||||
|         return udiProductDao.findByUuids(uuid); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean insertUdiInfo(UdiProductEntity udiProductEntity) { | ||||
|         if (udiProductEntity.getId() == null) { | ||||
|             udiProductEntity.setId(IdUtil.getSnowflakeNextId()); | ||||
|         } | ||||
|         return udiProductDao.insertUdiInfo(udiProductEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean insertUdiInfos(List<UdiProductEntity> udiInfoEntities) { | ||||
|         return udiProductDao.insertUdiInfos(udiInfoEntities); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean updateUdiInfo(UdiProductEntity udiProductEntity) { | ||||
|         if (StrUtil.isEmpty(udiProductEntity.getNameCode())) | ||||
|             return false; | ||||
|         return udiProductDao.updateUdiInfo(udiProductEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean updateUdiInfoByUuid(UdiProductEntity udiProductEntity) { | ||||
|         if (StrUtil.isEmpty(udiProductEntity.getUuid())) | ||||
|             return false; | ||||
|         return udiProductDao.updateUdiInfoByUuid(udiProductEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean updateUdiInfoById(UdiProductEntity udiProductEntity) { | ||||
|         return udiProductDao.updateUdiInfoById(udiProductEntity); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteById(String id) { | ||||
|         return udiProductDao.deleteById(id); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteByUuid(String uuid) { | ||||
|         return udiProductDao.deleteByUuid(uuid); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<String> getGgxhList(String relId) { | ||||
|         return udiProductDao.selectGgxhList(relId); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean updateUdiInfoNotAll(UdiInfoRequest udiInfoRequest) { | ||||
|         if (StrUtil.isEmpty(udiInfoRequest.getUuid())) | ||||
|             return false; | ||||
|         return udiProductDao.updateUdiInfoNotAll(udiInfoRequest); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiProductEntity getAllowNoBatch(String nameCode) { | ||||
|         String di = FilterUdiUtils.getDiStr(nameCode); | ||||
|         return udiProductDao.selectAllowNoBatch(di); | ||||
|     } | ||||
| } | ||||
| @ -1,405 +0,0 @@ | ||||
| package com.glxp.api.service.basic.impl; | ||||
| 
 | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| 
 | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.constant.ConstantStatus; | ||||
| import com.glxp.api.dao.basic.UdiRelevanceDao; | ||||
| import com.glxp.api.entity.basic.UdiEntity; | ||||
| import com.glxp.api.entity.basic.UdiRelevanceEntity; | ||||
| import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||
| import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||
| import com.glxp.api.service.basic.UdiRelevanceService; | ||||
| import com.glxp.api.util.udi.FilterUdiUtils; | ||||
| 
 | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import cn.hutool.core.util.StrUtil; | ||||
| 
 | ||||
| @Service | ||||
| @Transactional(rollbackFor = Exception.class) | ||||
| public class UdiRelevanceServiceImpl extends ServiceImpl<UdiRelevanceDao, UdiRelevanceEntity> implements UdiRelevanceService { | ||||
|     @Resource | ||||
|     UdiRelevanceDao udiRelevanceDao; | ||||
|     | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceResponse> filterUdiRelevance(FilterUdiRelRequest filterUdiRelRequest) { | ||||
|         if (filterUdiRelRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (filterUdiRelRequest.getPage() != null) { | ||||
|             int offset = (filterUdiRelRequest.getPage() - 1) * filterUdiRelRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, filterUdiRelRequest.getLimit()); | ||||
|         } | ||||
|         List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiRelevance(filterUdiRelRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceResponse> filterCertUdi(FilterUdiRelRequest filterUdiRelRequest) { | ||||
| 
 | ||||
| 
 | ||||
|         if (filterUdiRelRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (filterUdiRelRequest.getPage() != null) { | ||||
|             int offset = (filterUdiRelRequest.getPage() - 1) * filterUdiRelRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, filterUdiRelRequest.getLimit()); | ||||
|         } | ||||
|         List<UdiRelevanceResponse> data = udiRelevanceDao.filterCertUdi(filterUdiRelRequest); | ||||
|         return data; | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceResponse> filterUdiJoinSup(FilterUdiRelRequest filterUdiRelRequest) { | ||||
|         if (filterUdiRelRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (filterUdiRelRequest.getPage() != null) { | ||||
|             int offset = (filterUdiRelRequest.getPage() - 1) * filterUdiRelRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, filterUdiRelRequest.getLimit()); | ||||
|         } | ||||
|         List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiJoinSup(filterUdiRelRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceEntity> filterUdiEntity(FilterUdiRelRequest filterUdiRelRequest) { | ||||
| 
 | ||||
|         List<UdiRelevanceEntity> data = udiRelevanceDao.filterEntity(filterUdiRelRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceResponse> selectAllByNameCode(String nameCode) { | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         filterUdiRelRequest.setUniqueNameCode(nameCode); | ||||
|         List<UdiRelevanceResponse> udiRelevanceResponses = filterUdiRelevance(filterUdiRelRequest); | ||||
|         return udiRelevanceResponses; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiRelevanceResponse selectByNameCode(String nameCode) { | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         filterUdiRelRequest.setUniqueNameCode(nameCode); | ||||
|         List<UdiRelevanceResponse> udiRelevanceResponses = filterUdiRelevance(filterUdiRelRequest); | ||||
|         if (udiRelevanceResponses != null && udiRelevanceResponses.size() > 0) | ||||
|             return udiRelevanceResponses.get(0); | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiRelevanceResponse selectByRelId(String relId) { | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         filterUdiRelRequest.setRelId(relId); | ||||
|         List<UdiRelevanceResponse> udiRelevanceResponses = filterUdiRelevance(filterUdiRelRequest); | ||||
|         if (CollUtil.isNotEmpty(udiRelevanceResponses)) { | ||||
|             return udiRelevanceResponses.get(0); | ||||
|         } | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceResponse> selectAllByNameCode(String nameCode, String unitFk) { | ||||
|         List<UdiRelevanceResponse> udiRelevanceResponses; | ||||
|         if (StrUtil.isNotEmpty(unitFk)) { | ||||
|             FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|             filterUdiRelRequest.setUniqueNameCode(nameCode); | ||||
|             filterUdiRelRequest.setUnitFk(unitFk); | ||||
|             filterUdiRelRequest.setIsDisable(false); | ||||
|             udiRelevanceResponses = filterUdiJoinSup(filterUdiRelRequest); | ||||
|         } else { | ||||
|             udiRelevanceResponses = selectGroupByNameCode(nameCode, false); | ||||
|         } | ||||
|         if (udiRelevanceResponses.size() == 1) { | ||||
|             UdiRelevanceResponse udiRelevanceResponse = udiRelevanceResponses.get(0); | ||||
|             if (udiRelevanceResponse == null || udiRelevanceResponse.getProductType() == ConstantStatus.PRODUCT_TYPE_THIRD) { | ||||
|                 return selectByMainId(nameCode); | ||||
|             } | ||||
|         } | ||||
|         return udiRelevanceResponses; | ||||
| 
 | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean isExit() { | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         filterUdiRelRequest.setPage(1); | ||||
|         filterUdiRelRequest.setLimit(1); | ||||
|         List<UdiRelevanceResponse> data = filterUdiRelevance(filterUdiRelRequest); | ||||
|         if (data != null && data.size() > 0) { | ||||
|             return true; | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceResponse> filterUdiGp(FilterUdiRelRequest filterUdiRelRequest) { | ||||
|         if (filterUdiRelRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (filterUdiRelRequest.getPage() != null) { | ||||
|             int offset = (filterUdiRelRequest.getPage() - 1) * filterUdiRelRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, filterUdiRelRequest.getLimit()); | ||||
|         } | ||||
| 
 | ||||
|         List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiGp(filterUdiRelRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean isExitByUuid(String uuid) { | ||||
|         List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceDao.selectByUuid(uuid); | ||||
|         if (udiRelevanceEntities != null && !udiRelevanceEntities.isEmpty()) { | ||||
|             return true; | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceEntity> batchSelectByUuid(List<String> uuids) { | ||||
|         return udiRelevanceDao.batchSelectByUuid(uuids); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceEntity> batchSelectByIds(List<String> ids) { | ||||
|         return udiRelevanceDao.batchSelectByIds(ids); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceEntity> selectByUuid(String uuid) { | ||||
|         return udiRelevanceDao.selectByUuid(uuid); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiRelevanceEntity selectById(Long id) { | ||||
|         return udiRelevanceDao.selectById(id); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiRelevanceResponse selectGroupById(Long id) { | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         filterUdiRelRequest.setId(id); | ||||
|         filterUdiRelRequest.setDiType(1); | ||||
|         List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiRelevance(filterUdiRelRequest); | ||||
|         if (data != null && data.size() > 0) | ||||
|             return data.get(0); | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiRelevanceResponse selectUdiId(Long id) { | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         filterUdiRelRequest.setId(id); | ||||
|         List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiRelevance(filterUdiRelRequest); | ||||
|         if (data != null && data.size() > 0) | ||||
|             return data.get(0); | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiRelevanceResponse selectSupGroupById(Long id, String supId) { | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         if (StrUtil.isNotEmpty(supId)) | ||||
|             filterUdiRelRequest.setUnitFk(supId); | ||||
|         filterUdiRelRequest.setId(id); | ||||
|         filterUdiRelRequest.setDiType(1); | ||||
|         return udiRelevanceDao.selectOneUdiJoinSup(filterUdiRelRequest); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiRelevanceEntity selectUpdateByUuid(String uuid) { | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         filterUdiRelRequest.setUuid(uuid); | ||||
|         List<UdiRelevanceEntity> data = udiRelevanceDao.filterEntity(filterUdiRelRequest); | ||||
|         if (data != null && data.size() > 0) | ||||
|             return data.get(0); | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiRelevanceEntity selectUpdateByThirdId(String thirdId) { | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         if (thirdId != null) { | ||||
|            /* ThrSystemEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys(); | ||||
|             String mainSys = basicThirdSysEntity.getThirdId(); | ||||
|             if (mainSys.equals("thirdId")) { | ||||
|                 filterUdiRelRequest.setThirdId(thirdId); | ||||
|             } else if (mainSys.equals("thirdId1")) { | ||||
|                 filterUdiRelRequest.setThirdId1(thirdId); | ||||
|             } else if (mainSys.equals("thirdId2")) { | ||||
|                 filterUdiRelRequest.setThirdId2(thirdId); | ||||
|             } else if (mainSys.equals("thirdId3")) { | ||||
|                 filterUdiRelRequest.setThirdId3(thirdId); | ||||
|             } else if (mainSys.equals("thirdId4")) { | ||||
|                 filterUdiRelRequest.setThirdId4(thirdId); | ||||
|             }*/ | ||||
|         } | ||||
|         List<UdiRelevanceEntity> data = udiRelevanceDao.filterEntity(filterUdiRelRequest); | ||||
|         if (data != null && data.size() > 0) | ||||
|             return data.get(0); | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiRelevanceEntity selectByMainIdLimitOne(String mainId) { | ||||
| 
 | ||||
|         if (mainId == null) | ||||
|             return null; | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         filterUdiRelRequest.setMainId(mainId); | ||||
|         return udiRelevanceDao.selectByThirdId(filterUdiRelRequest); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceResponse> selectByMainId(String mainId) { | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         filterUdiRelRequest.setMainId(mainId); | ||||
|         List<UdiRelevanceResponse> udiRelevanceResponses = filterUdiRelevance(filterUdiRelRequest); | ||||
|         return udiRelevanceResponses; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiRelevanceEntity selectUpteaByAll(String uuid, String thirdId) { | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         if (thirdId != null) { | ||||
|             /*ThrSystemEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys(); | ||||
|             String mainSys = basicThirdSysEntity.getThirdId(); | ||||
|             filterUdiRelRequest.setUuid(uuid); | ||||
|             if (mainSys.equals("thirdId")) { | ||||
|                 filterUdiRelRequest.setThirdId(thirdId); | ||||
|             } else if (mainSys.equals("thirdId1")) { | ||||
|                 filterUdiRelRequest.setThirdId1(thirdId); | ||||
|             } else if (mainSys.equals("thirdId2")) { | ||||
|                 filterUdiRelRequest.setThirdId2(thirdId); | ||||
|             } else if (mainSys.equals("thirdId3")) { | ||||
|                 filterUdiRelRequest.setThirdId3(thirdId); | ||||
|             } else if (mainSys.equals("thirdId4")) { | ||||
|                 filterUdiRelRequest.setThirdId4(thirdId); | ||||
|             }*/ | ||||
|         } | ||||
| 
 | ||||
|         List<UdiRelevanceEntity> data = udiRelevanceDao.filterEntity(filterUdiRelRequest); | ||||
|         if (data != null && data.size() > 0) | ||||
|             return data.get(0); | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public UdiRelevanceEntity selectByThirdId(String thirdId, String thirdSys) { | ||||
| 
 | ||||
|         if (StrUtil.isEmpty(thirdId) || StrUtil.isEmpty(thirdSys)) { | ||||
|             return null; | ||||
|         } | ||||
| 
 | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         if ("thirdId".equals(thirdSys)) { | ||||
|             filterUdiRelRequest.setThirdId(thirdId); | ||||
|         } else if ("thirdId1".equals(thirdSys)) { | ||||
|             filterUdiRelRequest.setThirdId1(thirdId); | ||||
|         } else if ("thirdId2".equals(thirdSys)) { | ||||
|             filterUdiRelRequest.setThirdId2(thirdId); | ||||
|         } else if ("thirdId3".equals(thirdSys)) { | ||||
|             filterUdiRelRequest.setThirdId3(thirdId); | ||||
|         } else if ("thirdId4".equals(thirdSys)) { | ||||
|             filterUdiRelRequest.setThirdId4(thirdId); | ||||
|         } | ||||
| 
 | ||||
|         return udiRelevanceDao.selectByThirdId(filterUdiRelRequest); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceResponse> selectListByThirdId(String thirdId, String thirdSys) { | ||||
|         if (StrUtil.isEmpty(thirdId) || StrUtil.isEmpty(thirdSys)) { | ||||
|             return null; | ||||
|         } | ||||
| 
 | ||||
|         FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); | ||||
|         if ("thirdId".equals(thirdSys)) { | ||||
|             filterUdiRelRequest.setThirdId(thirdId); | ||||
|         } else if ("thirdId1".equals(thirdSys)) { | ||||
|             filterUdiRelRequest.setThirdId1(thirdId); | ||||
|         } else if ("thirdId2".equals(thirdSys)) { | ||||
|             filterUdiRelRequest.setThirdId2(thirdId); | ||||
|         } else if ("thirdId3".equals(thirdSys)) { | ||||
|             filterUdiRelRequest.setThirdId3(thirdId); | ||||
|         } else if ("thirdId4".equals(thirdSys)) { | ||||
|             filterUdiRelRequest.setThirdId4(thirdId); | ||||
|         } | ||||
|         List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiGp(filterUdiRelRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean insertUdiRelevance(UdiRelevanceEntity udiRelevanceEntity) { | ||||
|         return udiRelevanceDao.insertUdiRelevance(udiRelevanceEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean insertUdiRelevanceignore(UdiRelevanceEntity udiRelevanceEntity) { | ||||
|         return udiRelevanceDao.insertUdiRelevanceignore(udiRelevanceEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean updateUdiRelevance(UdiRelevanceEntity udiRelevanceEntity) { | ||||
|         /*ThrSystemEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys(); | ||||
|         String mainSys = basicThirdSysEntity.getThirdId(); | ||||
|         if (mainSys.equals("thirdId")) { | ||||
|             udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId()); | ||||
|         } else if (mainSys.equals("thirdId1")) { | ||||
|             udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId1()); | ||||
|         } else if (mainSys.equals("thirdId2")) { | ||||
|             udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId2()); | ||||
|         } else if (mainSys.equals("thirdId3")) { | ||||
|             udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId3()); | ||||
|         } else if (mainSys.equals("thirdId4")) { | ||||
|             udiRelevanceEntity.setMainId(udiRelevanceEntity.getThirdId4()); | ||||
|         }*/ | ||||
|         return udiRelevanceDao.updateUdiRelevance(udiRelevanceEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteById(String id) { | ||||
|         return udiRelevanceDao.deleteById(id); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteByIds(List<String> ids) { | ||||
|         return udiRelevanceDao.deleteByIds(ids); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteByUuid(String uuid) { | ||||
|         return udiRelevanceDao.deleteByUuid(uuid); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public String findUuidById(String relId) { | ||||
|         return udiRelevanceDao.selectUuidById(relId); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceResponse> selectGroupByNameCode(String nameCode, Boolean isDisable) { | ||||
|         return udiRelevanceDao.selectGroupByNameCode(nameCode, isDisable); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public String getRelIdByUdiCode(String code) { | ||||
|         if (StrUtil.isBlank(code)) { | ||||
|             return null; | ||||
|         } | ||||
|         UdiEntity udi = FilterUdiUtils.getUdi(code); | ||||
|         return udiRelevanceDao.selectRelIdByNameCode(udi.getUdi()); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,50 @@ | ||||
| package com.glxp.api.task; | ||||
| 
 | ||||
| import com.glxp.api.constant.AsyncDiDlHelper; | ||||
| import com.glxp.api.entity.basic.ProductInfoEntity; | ||||
| import com.glxp.api.service.basic.ProductInfoService; | ||||
| import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Value; | ||||
| import org.springframework.scheduling.annotation.Async; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| public class AsyncDiDlService { | ||||
| 
 | ||||
| 
 | ||||
|     @Value("${UDI_SERVER_URL}") | ||||
|     private String udiUrl; | ||||
| 
 | ||||
|     @Resource | ||||
|     ProductInfoService productInfoService; | ||||
|     @Resource | ||||
|     AsyncDiDlHelper asyncDiDlHelper; | ||||
|     private static final Logger logger = LoggerFactory.getLogger(AsyncDiDlService.class); | ||||
| 
 | ||||
|     @Async | ||||
|     public void asyncDiByTime(String updateTime) { | ||||
|         int page = 1; | ||||
|         int limit = 200; | ||||
|         while (true) { | ||||
|             logger.info("更新时间:" + updateTime + "----" + page + "----" + limit); | ||||
|             List<ProductInfoEntity> productInfoEntityList = asyncDiDlHelper.dlByTime(udiUrl, page, limit, updateTime); | ||||
|             if (productInfoEntityList != null && productInfoEntityList.size() > 0) { | ||||
|                 productInfoService.insertProductInfos(productInfoEntityList); | ||||
|                 if (productInfoEntityList.size() < limit) { | ||||
|                     break; | ||||
|                 } else { | ||||
|                     page++; | ||||
|                 } | ||||
|             } else { | ||||
|                 break; | ||||
|             } | ||||
|         } | ||||
|         logger.info("更新时间:" + updateTime + "----" + "下载结束"); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,63 @@ | ||||
| package com.glxp.api.task; | ||||
| 
 | ||||
| import com.glxp.api.dao.schedule.ScheduledDao; | ||||
| import com.glxp.api.entity.system.ScheduledEntity; | ||||
| import com.glxp.api.req.system.ScheduledRequest; | ||||
| import com.glxp.api.util.DateUtil; | ||||
| import com.glxp.api.util.RedisUtil; | ||||
| import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | ||||
| import org.springframework.scheduling.annotation.EnableScheduling; | ||||
| import org.springframework.scheduling.annotation.SchedulingConfigurer; | ||||
| import org.springframework.scheduling.config.ScheduledTaskRegistrar; | ||||
| import org.springframework.scheduling.support.CronTrigger; | ||||
| import org.springframework.stereotype.Component; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @Component | ||||
| @EnableScheduling | ||||
| public class AsyncDiDlTask implements SchedulingConfigurer { | ||||
| 
 | ||||
|     final Logger logger = LoggerFactory.getLogger(AsyncDiDlTask.class); | ||||
|     @Resource | ||||
|     RedisUtil redisUtil; | ||||
|     @Resource | ||||
|     private ScheduledDao scheduledDao; | ||||
|     @Resource | ||||
|     AsyncDiDlService asyncDiDlService; | ||||
| 
 | ||||
|     @Override | ||||
|     public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { | ||||
|         scheduledTaskRegistrar.addTriggerTask(() -> process(), | ||||
|                 triggerContext -> { | ||||
|                     ScheduledRequest scheduledRequest = new ScheduledRequest(); | ||||
|                     scheduledRequest.setCronName("syncDi"); | ||||
|                     ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest); | ||||
|                     if (scheduledEntity == null) { | ||||
|                         return null; | ||||
|                     } | ||||
|                     String cron = scheduledEntity.getCron();//"0 55 5 * * ?";
 | ||||
|                     if (cron.isEmpty()) { | ||||
|                         logger.error("cron is null"); | ||||
|                     } | ||||
|                     return new CronTrigger(cron).nextExecutionTime(triggerContext); | ||||
|                 }); | ||||
|     } | ||||
| 
 | ||||
|     private void process() { | ||||
|         String day = DateUtil.getLastDayFormat(-1); | ||||
|         asyncDiDlService.asyncDiByTime(day); | ||||
| 
 | ||||
| 
 | ||||
|         String lastUpDiTime = (String) redisUtil.get("lastDiUpTime"); | ||||
|         if (lastUpDiTime == null) { | ||||
|             lastUpDiTime = DateUtil.getLastDayFormat(-10); | ||||
|         } | ||||
|         asyncDiDlService.asyncDiByTime(lastUpDiTime); | ||||
|         redisUtil.set("lastDiUpTime", DateUtil.formatDate(new Date())); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -1,226 +0,0 @@ | ||||
| <?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.basic.CompanyProductRelevanceDao"> | ||||
|     <insert id="insertCompanyProductRelevance" | ||||
|             parameterType="com.glxp.api.entity.basic.CompanyProductRelevanceEntity"> | ||||
|         replace | ||||
|                 INTO company_product_relevance(id, customerId, productId, enterpriseId, registrationId, | ||||
|                                                createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk, | ||||
|                                                price) | ||||
|         values (#{id}, #{customerId}, | ||||
|                 #{productId}, | ||||
|                 #{enterpriseId}, | ||||
|                 #{registrationId}, | ||||
|                 #{createTime}, | ||||
|                 #{updateTime}, | ||||
|                 #{auditStatus}, | ||||
|                 #{productUuid}, | ||||
|                 #{udiRlIdFk}, | ||||
|                 #{unitFk}, #{price}) | ||||
|     </insert> | ||||
| 
 | ||||
| 
 | ||||
|     <insert id="importCompanyProductRelevance" | ||||
|             parameterType="com.glxp.api.entity.basic.CompanyProductRelevanceEntity"> | ||||
|         replace | ||||
|                 INTO company_product_relevance(id, customerId, productId, enterpriseId, registrationId, | ||||
|                                                create_time, update_time, auditStatus, productUuid, udiRlIdFk, unitFk, | ||||
|                                                price) | ||||
|         values (#{id}, | ||||
|                 #{customerId}, | ||||
|                 #{productId}, | ||||
|                 #{enterpriseId}, | ||||
|                 #{registrationId}, | ||||
|                 #{create_time}, | ||||
|                 #{update_time}, | ||||
|                 #{auditStatus}, | ||||
|                 #{productUuid}, | ||||
|                 #{udiRlIdFk}, | ||||
|                 #{unitFk}, #{price}) | ||||
|     </insert> | ||||
| 
 | ||||
|     <delete id="deleteById" parameterType="Map"> | ||||
|         DELETE | ||||
|         FROM company_product_relevance | ||||
|         WHERE id = #{id} | ||||
|     </delete> | ||||
| 
 | ||||
| 
 | ||||
|     <delete id="deleteByRlId" parameterType="Map"> | ||||
|         DELETE | ||||
|         FROM company_product_relevance | ||||
|         WHERE udiRlIdFk = #{id} | ||||
|     </delete> | ||||
| 
 | ||||
|     <select id="filterUdiGp" parameterType="com.glxp.api.req.basic.CompanyProductRelevanceRequest" | ||||
|             resultType="com.glxp.api.res.basic.CompanyProductRelevanceResponse"> | ||||
|         SELECT company_product_relevance.id, | ||||
|                company_product_relevance.customerId, | ||||
|                company_product_relevance.auditStatus, | ||||
|                basic_udirel.thirdId, | ||||
|                basic_udirel.id rlId, | ||||
|                basic_udirel.isUseDy, | ||||
|                basic_udirel.isLock, | ||||
|                basic_udirel.thirdId1, | ||||
|                basic_udirel.thirdId2, | ||||
|                basic_udirel.thirdId3, | ||||
|                basic_udirel.thirdId4, | ||||
|                basic_udirel.lockStatus, | ||||
|                basic_products.allowNoBatch, | ||||
|                basic_products.allowNoExpire, | ||||
|                basic_products.allowNoProduct, | ||||
|                basic_products.allowNoSerial, | ||||
|                basic_products.productType, | ||||
|                basic_products.nameCode, | ||||
|                basic_products.packRatio, | ||||
|                basic_products.packLevel, | ||||
|                basic_products.bhxjsl, | ||||
|                basic_products.bhzxxsbzsl, | ||||
|                basic_products.zxxsbzbhsydysl, | ||||
|                basic_products.bhxjcpbm, | ||||
|                basic_products.bzcj, | ||||
|                basic_udirel.isDisable, | ||||
|                basic_products.deviceRecordKey, | ||||
|                basic_products.cpmctymc, | ||||
|                basic_products.cplb, | ||||
|                basic_products.flbm, | ||||
|                basic_products.ggxh, | ||||
|                basic_products.qxlb, | ||||
|                basic_products.tyshxydm, | ||||
|                basic_products.ylqxzcrbarmc, | ||||
|                basic_products.zczbhhzbapzbh, | ||||
|                basic_products.ylqxzcrbarywmc, | ||||
|                basic_products.sydycpbs, | ||||
|                basic_products.uuid, | ||||
|                basic_products.sjcpbm, | ||||
|                basic_products.versionNumber, | ||||
|                basic_products.diType, | ||||
|                customer_info.companyName, | ||||
|                basic_udirel.mainId, | ||||
|                basic_udirel.isAdavence, | ||||
|                basic_products.scbssfbhph, | ||||
|                basic_products.scbssfbhxlh, | ||||
|                basic_products.scbssfbhscrq, | ||||
|                basic_products.cpdls, | ||||
|                basic_products.scbssfbhsxrq, | ||||
|                basic_products.cpms, | ||||
|                basic_products.originUuid, | ||||
|                company_product_relevance.price, | ||||
|                basic_products.spmc, | ||||
|                basic_products.basicPrductRemak1, | ||||
|                basic_products.basicPrductRemak2, | ||||
|                basic_products.basicPrductRemak3, | ||||
|                basic_products.basicPrductRemak4, | ||||
|                basic_products.basicPrductRemak5, | ||||
|                basic_products.basicPrductRemak6, | ||||
|                basic_products.basicPrductRemak7, | ||||
|                basic_products.basicPrductRemak8 | ||||
|         FROM company_product_relevance | ||||
|                      INNER JOIN basic_udirel ON company_product_relevance.udiRlIdFk = basic_udirel.id | ||||
|                      INNER JOIN basic_products ON basic_udirel.uuid = basic_products.uuid | ||||
|                      INNER JOIN customer_info ON customer_info.customerId = company_product_relevance.customerId | ||||
|         <where> | ||||
|             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null"> | ||||
|                 AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%') | ||||
|             </if> | ||||
|             <if test="cpmctymc != '' and cpmctymc != null"> | ||||
|                 AND cpmctymc LIKE concat(#{cpmctymc}, '%') | ||||
|             </if> | ||||
|             <if test="nameCode != '' and nameCode != null"> | ||||
|                 AND nameCode LIKE concat(#{nameCode}, '%') | ||||
|             </if> | ||||
|             <if test="ggxh != '' and ggxh != null"> | ||||
|                 AND ggxh LIKE concat('%', #{ggxh}, '%') | ||||
|             </if> | ||||
|             <if test="unionCode != '' and unionCode != null"> | ||||
|                 and ( | ||||
|                         nameCode LIKE concat('%', #{unionCode}, '%') | ||||
|                                 or basic_products.ybbm LIKE concat('%', #{unionCode}, '%') | ||||
|                                 or basic_products.sptm LIKE concat('%', #{unionCode}, '%') | ||||
|                         ) | ||||
|             </if> | ||||
|             <if test="thrPiId != '' and thrPiId != null"> | ||||
|                 and ( | ||||
|                         thirdId LIKE concat('%', #{thrPiId}, '%') | ||||
|                                 or thirdId1 LIKE concat('%', #{thrPiId}, '%') | ||||
|                                 or thirdId2 LIKE concat('%', #{thrPiId}, '%') | ||||
|                                 or thirdId3 LIKE concat('%', #{thrPiId}, '%') | ||||
|                                 or thirdId4 LIKE concat('%', #{thrPiId}, '%') | ||||
|                         ) | ||||
|             </if> | ||||
|             <if test="uuid != '' and uuid != null"> | ||||
|                 AND basic_udirel.uuid = #{uuid} | ||||
|             </if> | ||||
|             <if test="thirdId != '' and thirdId != null"> | ||||
|                 AND thirdId = #{thirdId} | ||||
|             </if> | ||||
|             <if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null"> | ||||
|                 AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh}, '%') | ||||
|             </if> | ||||
|             <if test="diType != '' and diType != null"> | ||||
|                 AND diType = #{diType} | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 1"> | ||||
|                 AND (thirdId <![CDATA[<>]]> '' or thirdId1 <![CDATA[<>]]> '' or thirdId2 <![CDATA[<>]]> '' or | ||||
|                      thirdId3 <![CDATA[<>]]> '' or thirdId4 <![CDATA[<>]]> '') | ||||
|                 and basic_products.originUuid <![CDATA[<>]]> '' | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 2"> | ||||
|                 AND basic_products.originUuid is NULL | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 3"> | ||||
|                 AND mainId is NULL | ||||
|                 and basic_products.originUuid <![CDATA[<>]]> '' | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 4"> | ||||
|                 AND thirdId1 is NULL | ||||
|                 and basic_products.flbm <![CDATA[<>]]> '' | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 5"> | ||||
|                 AND thirdId2 is NULL | ||||
|                 and basic_products.flbm <![CDATA[<>]]> '' | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 6"> | ||||
|                 AND thirdId3 is NULL | ||||
|                 and basic_products.flbm <![CDATA[<>]]> '' | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 7"> | ||||
|                 AND thirdId4 is NULL | ||||
|                 and basic_products.flbm <![CDATA[<>]]> '' | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 10"> | ||||
|                 AND basic_udirel.updateTime is NULL | ||||
|             </if> | ||||
| 
 | ||||
|             <if test="customerId != '' and customerId != null"> | ||||
|                 AND company_product_relevance.customerId = #{customerId} | ||||
|             </if> | ||||
|             <if test="auditStatus != '' and auditStatus != null"> | ||||
|                 AND company_product_relevance.auditStatus = #{auditStatus} | ||||
|             </if> | ||||
|             <if test="id != '' and id != null"> | ||||
|                 AND basic_udirel.id = #{id} | ||||
|             </if> | ||||
|             <if test="companyName != '' and companyName != null"> | ||||
|                 AND customer_info.companyName = #{companyName} | ||||
|             </if> | ||||
|             <if test="lockStatus != '' and lockStatus != null"> | ||||
|                 AND basic_udirel.lockStatus = #{lockStatus} | ||||
|             </if> | ||||
|             <if test="isAdavence != '' and isAdavence != null"> | ||||
|                 AND basic_udirel.isAdavence = #{isAdavence} | ||||
|             </if> | ||||
|             <if test="unitFk != null and unitFk != ''"> | ||||
|                 and unitFk = #{unitFk} | ||||
|             </if> | ||||
|             <if test="originUuid != null and originUuid != ''"> | ||||
|                 and originUuid = #{originUuid} | ||||
|             </if> | ||||
|             <if test="isDisable == false"> | ||||
|                 AND (basic_udirel.isDisable is null or basic_udirel.isDisable = false) | ||||
|             </if> | ||||
|         </where> | ||||
|         ORDER BY company_product_relevance.updateTime DESC | ||||
|     </select> | ||||
| </mapper> | ||||
| @ -1,964 +0,0 @@ | ||||
| <?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.basic.UdiProductDao"> | ||||
|     <select id="filterUdiInfo" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest" | ||||
|             resultType="com.glxp.api.entity.basic.UdiProductEntity"> | ||||
|         SELECT * | ||||
|         FROM basic_products | ||||
|         <where> | ||||
|             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null"> | ||||
|                 AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%') | ||||
|             </if> | ||||
|             <if test="cpmctymc != '' and cpmctymc != null"> | ||||
|                 AND cpmctymc LIKE concat(#{cpmctymc}, '%') | ||||
|             </if> | ||||
|             <if test="nameCode != '' and nameCode != null"> | ||||
|                 AND nameCode LIKE concat(#{nameCode}, '%') | ||||
|             </if> | ||||
|             <if test="uuid != '' and uuid != null"> | ||||
|                 AND uuid = #{uuid} | ||||
|             </if> | ||||
|             <if test="originUuid != '' and originUuid != null"> | ||||
|                 AND originUuid = #{originUuid} | ||||
|             </if> | ||||
|             <if test="sptm != '' and sptm != null"> | ||||
|                 AND sptm = #{sptm} | ||||
|             </if> | ||||
|         </where> | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="filterUdiInfo2" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest" | ||||
|             resultType="com.glxp.api.res.basic.UdiRelevanceResponse"> | ||||
|         SELECT basic_products.id, | ||||
|                basic_udirel.thirdId, | ||||
|                basic_udirel.thirdName, | ||||
|                basic_udirel.isUseDy, | ||||
|                basic_udirel.thirdId1, | ||||
|                basic_udirel.thirdId2, | ||||
|                basic_udirel.thirdId3, | ||||
|                basic_udirel.thirdId4, | ||||
|                basic_udirel.ybbm, | ||||
|                basic_udirel.sptm, | ||||
|                basic_udirel.isDisable, | ||||
|                basic_udirel.thirdName1, | ||||
|                basic_udirel.thirdName2, | ||||
|                basic_udirel.thirdName3, | ||||
|                basic_udirel.thirdName4, | ||||
|                basic_udirel.manufactory, | ||||
|                basic_udirel.measname, | ||||
|                basic_udirel.udplatCode, | ||||
|                basic_products.nameCode, | ||||
|                basic_products.packRatio, | ||||
|                basic_products.packLevel, | ||||
|                basic_products.packUnit, | ||||
|                basic_products.bhxjsl, | ||||
|                basic_products.bhzxxsbzsl, | ||||
|                basic_products.zxxsbzbhsydysl, | ||||
|                basic_products.bhxjcpbm, | ||||
|                basic_products.bzcj, | ||||
|                basic_products.addType, | ||||
|                basic_products.deviceRecordKey, | ||||
|                basic_products.cpmctymc, | ||||
|                basic_products.cplb, | ||||
|                basic_products.flbm, | ||||
|                basic_products.ggxh, | ||||
|                basic_products.qxlb, | ||||
|                basic_products.tyshxydm, | ||||
|                basic_products.ylqxzcrbarmc, | ||||
|                basic_products.zczbhhzbapzbh, | ||||
|                basic_products.ylqxzcrbarywmc, | ||||
|                basic_products.sydycpbs, | ||||
|                basic_products.uuid, | ||||
|                basic_products.sjcpbm, | ||||
|                basic_products.versionNumber, | ||||
|                basic_products.diType, | ||||
|                basic_products.scbssfbhph, | ||||
|                basic_products.scbssfbhxlh, | ||||
|                basic_products.scbssfbhscrq, | ||||
|                basic_products.scbssfbhsxrq, | ||||
|                basic_products.cpms, | ||||
|                basic_products.originUuid, | ||||
|                basic_products.allowNoBatch, | ||||
|                basic_products.allowNoExpire, | ||||
|                basic_products.allowNoProduct, | ||||
|                basic_products.allowNoSerial, | ||||
|                basic_products.spmc, | ||||
|                basic_products.cplx, | ||||
|                basic_products.hchzsb | ||||
|         FROM (company_product_relevance | ||||
|                 inner JOIN basic_udirel | ||||
|                 ON company_product_relevance.udiRlIdFk = basic_udirel.id) | ||||
|                      inner JOIN basic_products | ||||
|                 ON basic_udirel.uuid = basic_products.uuid | ||||
|         <where> | ||||
|             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null"> | ||||
|                 AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%') | ||||
|             </if> | ||||
|             <if test="cpmctymc != '' and cpmctymc != null"> | ||||
|                 AND cpmctymc LIKE concat(#{cpmctymc}, '%') | ||||
|             </if> | ||||
|             <if test="nameCode != '' and nameCode != null"> | ||||
|                 AND nameCode LIKE concat(#{nameCode}, '%') | ||||
|             </if> | ||||
|             <if test="unionCode != '' and unionCode != null"> | ||||
|                 or nameCode LIKE concat('%', #{unionCode}, '%') | ||||
|                 or basic_udirel.ybbm LIKE concat('%', #{unionCode}, '%') | ||||
|                 or basic_udirel.sptm LIKE concat('%', #{unionCode}, '%') | ||||
|             </if> | ||||
|             <if test="thrPiId != '' and thrPiId != null"> | ||||
|                 or thirdId LIKE concat('%', #{thrPiId}, '%') | ||||
|                 or thirdId1 LIKE concat('%', #{thrPiId}, '%') | ||||
|                 or thirdId2 LIKE concat('%', #{thrPiId}, '%') | ||||
|                 or thirdId3 LIKE concat('%', #{thrPiId}, '%') | ||||
|                 or thirdId4 LIKE concat('%', #{thrPiId}, '%') | ||||
|             </if> | ||||
|             <if test="uuid != '' and uuid != null"> | ||||
|                 AND uuid = #{uuid} | ||||
|             </if> | ||||
|             <if test="thirdId != '' and thirdId != null"> | ||||
|                 AND thirdId = #{thirdId} | ||||
|             </if> | ||||
|             <if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null"> | ||||
|                 AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh}, '%') | ||||
|             </if> | ||||
|             <if test="customerId != '' and customerId != null"> | ||||
|                 AND company_product_relevance.customerId = #{customerId} | ||||
|             </if> | ||||
|             <if test="originUuid != '' and originUuid != null"> | ||||
|                 AND originUuid = #{originUuid} | ||||
|             </if> | ||||
|         </where> | ||||
|         ORDER BY updateTime DESC | ||||
|     </select> | ||||
|     <!--//       AND company_product_relevance.auditStatus = 1--> | ||||
|     <select id="findById" parameterType="java.lang.String" | ||||
|             resultType="com.glxp.api.entity.basic.UdiProductEntity"> | ||||
|         SELECT * | ||||
|         FROM basic_products | ||||
|         WHERE (id = #{id}) | ||||
|         limit 1 | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="findByUuid" parameterType="java.lang.String" | ||||
|             resultType="com.glxp.api.entity.basic.UdiProductEntity"> | ||||
|         SELECT * | ||||
|         FROM basic_products | ||||
|         WHERE (uuid = #{uuid}) | ||||
|         limit 1 | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="findByUuids" parameterType="java.lang.String" | ||||
|             resultType="com.glxp.api.entity.basic.UdiProductEntity"> | ||||
|         SELECT * | ||||
|         FROM basic_products | ||||
|         WHERE (uuid = #{uuid}) | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="findByNameCode" parameterType="java.lang.String" | ||||
|             resultType="com.glxp.api.entity.basic.UdiProductEntity"> | ||||
|         SELECT * | ||||
|         FROM basic_products | ||||
|         WHERE (nameCode = #{nameCode}) | ||||
|         limit 1 | ||||
|     </select> | ||||
|     <insert id="insertUdiInfo" keyProperty="id" parameterType="com.glxp.api.entity.basic.UdiProductEntity"> | ||||
|         replace | ||||
|                 INTO basic_products | ||||
|                 (id, uuid, originUuid, nameCode, deviceRecordKey, packRatio, packLevel, packUnit, bhxjsl, bhzxxsbzsl, | ||||
|                  zxxsbzbhsydysl, bhxjcpbm, bzcj, cpmctymc, cplb, flbm, ggxh, qxlb, tyshxydm, | ||||
|                  ylqxzcrbarmc, zczbhhzbapzbh, ylqxzcrbarywmc, sydycpbs, sjcpbm, versionNumber, diType, ybbm, sptm, | ||||
|                  manufactory, measname, productType, scbssfbhph, scbssfbhxlh, scbssfbhscrq, scbssfbhsxrq, cpms, | ||||
|                  allowNoBatch, allowNoExpire, | ||||
|                  allowNoProduct, allowNoSerial, spmc, cplx, hchzsb, cpdls, price, basicPrductRemak1, basicPrductRemak2, | ||||
|                  basicPrductRemak3, basicPrductRemak4, basicPrductRemak5, basicPrductRemak6, basicPrductRemak7, | ||||
|                  basicPrductRemak8) | ||||
|         values (#{id}, #{uuid}, | ||||
|                 #{originUuid}, | ||||
|                 #{nameCode}, | ||||
|                 #{deviceRecordKey}, | ||||
|                 #{packRatio}, | ||||
|                 #{packLevel}, | ||||
|                 #{packUnit}, | ||||
|                 #{bhxjsl}, | ||||
|                 #{bhzxxsbzsl }, | ||||
|                 #{zxxsbzbhsydysl}, | ||||
|                 #{bhxjcpbm}, | ||||
|                 #{bzcj}, | ||||
|                 #{cpmctymc}, | ||||
|                 #{cplb}, | ||||
|                 #{flbm}, | ||||
|                 #{ggxh}, | ||||
|                 #{qxlb}, | ||||
|                 #{tyshxydm}, | ||||
|                 #{ylqxzcrbarmc}, | ||||
|                 #{zczbhhzbapzbh}, | ||||
|                 #{ylqxzcrbarywmc}, | ||||
|                 #{sydycpbs}, | ||||
|                 #{sjcpbm}, | ||||
|                 #{versionNumber}, | ||||
|                 #{diType}, | ||||
|                 #{ybbm}, | ||||
|                 #{sptm}, | ||||
|                 #{manufactory}, | ||||
|                 #{measname}, | ||||
|                 #{productType}, | ||||
|                 #{scbssfbhph}, | ||||
|                 #{scbssfbhxlh}, | ||||
|                 #{scbssfbhscrq}, | ||||
|                 #{scbssfbhsxrq}, | ||||
|                 #{cpms}, | ||||
|                 #{allowNoBatch}, | ||||
|                 #{allowNoExpire}, | ||||
|                 #{allowNoProduct}, #{allowNoSerial}, | ||||
|                 #{spmc}, | ||||
|                 #{cplx}, | ||||
|                 #{hchzsb}, | ||||
|                 #{cpdls}, | ||||
|                 #{price}, | ||||
|                 #{basicPrductRemak1}, | ||||
|                 #{basicPrductRemak2}, | ||||
|                 #{basicPrductRemak3}, | ||||
|                 #{basicPrductRemak4}, | ||||
|                 #{basicPrductRemak5}, | ||||
|                 #{basicPrductRemak6}, | ||||
|                 #{basicPrductRemak7}, | ||||
|                 #{basicPrductRemak8}) | ||||
|     </insert> | ||||
| 
 | ||||
|     <insert id="insertUdiInfos" keyProperty="id" parameterType="java.util.List"> | ||||
|         replace INTO basic_products | ||||
|                 (id, uuid, originUuid, nameCode, deviceRecordKey, packRatio, packLevel, packUnit, bhxjsl, bhzxxsbzsl, | ||||
|                  zxxsbzbhsydysl, bhxjcpbm, bzcj, cpmctymc, cplb, flbm, ggxh, qxlb, tyshxydm, | ||||
|                  ylqxzcrbarmc, zczbhhzbapzbh, ylqxzcrbarywmc, sydycpbs, sjcpbm, versionNumber, diType, ybbm, sptm, | ||||
|                  manufactory, measname, productType, scbssfbhph, scbssfbhxlh, scbssfbhscrq, scbssfbhsxrq, cpms, | ||||
|                  allowNoBatch, allowNoExpire, | ||||
|                  allowNoProduct, allowNoSerial, spmc, cplx, hchzsb, cpdls, price, basicPrductRemak1, basicPrductRemak2, | ||||
|                  basicPrductRemak3, basicPrductRemak4, basicPrductRemak5, basicPrductRemak6, basicPrductRemak7, | ||||
|                  basicPrductRemak8) | ||||
|                 values | ||||
| 
 | ||||
|         <foreach collection="udiInfoEntities" item="item" index="index" | ||||
|                  separator=","> | ||||
|             (#{item.id}, | ||||
|              #{item.uuid}, | ||||
|              #{item.originUuid}, | ||||
|              #{item.nameCode}, | ||||
|              #{item.deviceRecordKey}, | ||||
|              #{item.packRatio}, | ||||
|              #{item.packLevel}, | ||||
|              #{item.packUnit}, | ||||
|              #{item.bhxjsl}, | ||||
|              #{item.bhzxxsbzsl}, | ||||
|              #{item.zxxsbzbhsydysl}, | ||||
|              #{item.bhxjcpbm}, | ||||
|              #{item.bzcj}, | ||||
|              #{item.cpmctymc}, | ||||
|              #{item.cplb}, | ||||
|              #{item.flbm}, | ||||
|              #{item.ggxh}, | ||||
|              #{item.qxlb}, | ||||
|              #{item.tyshxydm}, | ||||
|              #{item.ylqxzcrbarmc}, | ||||
|              #{item.zczbhhzbapzbh}, | ||||
|              #{item.ylqxzcrbarywmc}, | ||||
|              #{item.sydycpbs}, | ||||
|              #{item.sjcpbm}, | ||||
|              #{item.versionNumber}, | ||||
|              #{item.diType}, | ||||
|              #{item.ybbm}, | ||||
|              #{item.sptm}, | ||||
|              #{item.manufactory}, | ||||
|              #{item.measname}, | ||||
|              #{item.productType}, | ||||
|              #{item.scbssfbhph}, | ||||
|              #{item.scbssfbhxlh}, | ||||
|              #{item.scbssfbhscrq}, | ||||
|              #{item.scbssfbhsxrq}, | ||||
|              #{item.cpms}, | ||||
|              #{item.allowNoBatch}, | ||||
|              #{item.allowNoExpire}, | ||||
|              #{item.allowNoProduct}, #{item.allowNoSerial}, | ||||
|              #{item.spmc}, | ||||
|              #{item.cplx}, | ||||
|              #{item.hchzsb}, | ||||
|              #{item.cpdls}, | ||||
|              #{item.price}, | ||||
|              #{item.basicPrductRemak1}, | ||||
|              #{item.basicPrductRemak2}, | ||||
|              #{item.basicPrductRemak3}, | ||||
|              #{item.basicPrductRemak4}, | ||||
|              #{item.basicPrductRemak5}, | ||||
|              #{item.basicPrductRemak6}, | ||||
|              #{item.basicPrductRemak7}, | ||||
|              #{item.basicPrductRemak8}) | ||||
|         </foreach> | ||||
|     </insert> | ||||
| 
 | ||||
|     <delete id="deleteById" parameterType="Map"> | ||||
|         DELETE | ||||
|         FROM basic_products | ||||
|         WHERE id = #{id} | ||||
|     </delete> | ||||
| 
 | ||||
|     <delete id="deleteByUuid" parameterType="Map"> | ||||
|         DELETE | ||||
|         FROM basic_products | ||||
|         WHERE uuid = #{uuid} | ||||
|     </delete> | ||||
| 
 | ||||
|     <update id="updateUdiInfo" parameterType="com.glxp.api.entity.basic.UdiProductEntity"> | ||||
|         UPDATE basic_products | ||||
|         <trim prefix="set" suffixOverrides=","> | ||||
|             <if test="originUuid != null"> | ||||
|                 originUuid=#{originUuid}, | ||||
|             </if> | ||||
|             <if test="nameCode != null"> | ||||
|                 nameCode=#{nameCode}, | ||||
|             </if> | ||||
|             <if test="deviceRecordKey != null"> | ||||
|                 deviceRecordKey=#{deviceRecordKey}, | ||||
|             </if> | ||||
|             <if test="packRatio != null"> | ||||
|                 packRatio=#{packRatio}, | ||||
|             </if> | ||||
|             <if test="packLevel != null"> | ||||
|                 packLevel=#{packLevel}, | ||||
|             </if> | ||||
|             <if test="packUnit != null"> | ||||
|                 packUnit=#{packUnit}, | ||||
|             </if> | ||||
|             <if test="bhxjsl != null"> | ||||
|                 bhxjsl=#{bhxjsl}, | ||||
|             </if> | ||||
|             <if test="bhzxxsbzsl != null"> | ||||
|                 bhzxxsbzsl=#{bhzxxsbzsl}, | ||||
|             </if> | ||||
|             <if test="zxxsbzbhsydysl != null"> | ||||
|                 zxxsbzbhsydysl=#{zxxsbzbhsydysl}, | ||||
|             </if> | ||||
|             <if test="bhxjcpbm != null"> | ||||
|                 bhxjcpbm=#{bhxjcpbm}, | ||||
|             </if> | ||||
|             <if test="bzcj != null"> | ||||
|                 bzcj=#{bzcj}, | ||||
|             </if> | ||||
|             <if test="cpmctymc != null"> | ||||
|                 cpmctymc=#{cpmctymc}, | ||||
|             </if> | ||||
|             <if test="cplb != null"> | ||||
|                 cplb=#{cplb}, | ||||
|             </if> | ||||
|             <if test="flbm != null"> | ||||
|                 flbm=#{flbm}, | ||||
|             </if> | ||||
|             <if test="ggxh != null"> | ||||
|                 ggxh=#{ggxh}, | ||||
|             </if> | ||||
|             <if test="qxlb != null"> | ||||
|                 qxlb=#{qxlb}, | ||||
|             </if> | ||||
|             <if test="tyshxydm != null"> | ||||
|                 tyshxydm=#{tyshxydm}, | ||||
|             </if> | ||||
|             <if test="ylqxzcrbarmc != null"> | ||||
|                 ylqxzcrbarmc=#{ylqxzcrbarmc}, | ||||
|             </if> | ||||
|             <if test="zczbhhzbapzbh != null"> | ||||
|                 zczbhhzbapzbh=#{zczbhhzbapzbh}, | ||||
|             </if> | ||||
|             <if test="ylqxzcrbarywmc != null"> | ||||
|                 ylqxzcrbarywmc=#{ylqxzcrbarywmc}, | ||||
|             </if> | ||||
|             <if test="sydycpbs != null"> | ||||
|                 sydycpbs=#{sydycpbs}, | ||||
|             </if> | ||||
|             <if test="sjcpbm != null"> | ||||
|                 sjcpbm=#{sjcpbm}, | ||||
|             </if> | ||||
|             <if test="versionNumber != null"> | ||||
|                 versionNumber=#{versionNumber}, | ||||
|             </if> | ||||
|             <if test="diType != null"> | ||||
|                 diType=#{diType}, | ||||
|             </if> | ||||
|             <if test="ybbm != null"> | ||||
|                 ybbm=#{ybbm}, | ||||
|             </if> | ||||
|             <if test="sptm != null"> | ||||
|                 sptm=#{sptm}, | ||||
|             </if> | ||||
|             <if test="manufactory != null"> | ||||
|                 manufactory=#{manufactory}, | ||||
|             </if> | ||||
|             <if test="measname != null"> | ||||
|                 measname=#{measname}, | ||||
|             </if> | ||||
|             <if test="productType != null"> | ||||
|                 productType=#{productType}, | ||||
|             </if> | ||||
|             <if test="scbssfbhph != null"> | ||||
|                 scbssfbhph=#{scbssfbhph}, | ||||
|             </if> | ||||
|             <if test="scbssfbhxlh != null"> | ||||
|                 scbssfbhxlh=#{scbssfbhxlh}, | ||||
|             </if> | ||||
|             <if test="scbssfbhscrq != null"> | ||||
|                 scbssfbhscrq=#{scbssfbhscrq}, | ||||
|             </if> | ||||
|             <if test="scbssfbhsxrq != null"> | ||||
|                 scbssfbhsxrq=#{scbssfbhsxrq}, | ||||
|             </if> | ||||
|             <if test="cpms != null"> | ||||
|                 cpms=#{cpms}, | ||||
|             </if> | ||||
|             <if test="allowNoBatch != null"> | ||||
|                 allowNoBatch=#{allowNoBatch}, | ||||
|             </if> | ||||
|             <if test="allowNoExpire != null"> | ||||
|                 allowNoExpire=#{allowNoExpire}, | ||||
|             </if> | ||||
|             <if test="allowNoProduct != null"> | ||||
|                 allowNoProduct=#{allowNoProduct}, | ||||
|             </if> | ||||
|             <if test="allowNoSerial != null"> | ||||
|                 allowNoSerial=#{allowNoSerial}, | ||||
|             </if> | ||||
| 
 | ||||
| 
 | ||||
|             <if test="spmc != null"> | ||||
|                 spmc=#{spmc}, | ||||
|             </if> | ||||
|             <if test="cplx != null"> | ||||
|                 cplx=#{cplx}, | ||||
|             </if> | ||||
|             <if test="hchzsb != null"> | ||||
|                 hchzsb=#{hchzsb}, | ||||
|             </if> | ||||
|             <if test="cpdls != null"> | ||||
|                 cpdls=#{cpdls}, | ||||
|             </if> | ||||
|             <if test="price != null"> | ||||
|                 price=#{price}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak1 != null"> | ||||
|                 basicPrductRemak1=#{basicPrductRemak1}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak2 != null"> | ||||
|                 basicPrductRemak2=#{basicPrductRemak2}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak3 != null"> | ||||
|                 basicPrductRemak3=#{basicPrductRemak3}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak4 != null"> | ||||
|                 basicPrductRemak4=#{basicPrductRemak4}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak5 != null"> | ||||
|                 basicPrductRemak5=#{basicPrductRemak5}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak6 != null"> | ||||
|                 basicPrductRemak6=#{basicPrductRemak6}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak7 != null"> | ||||
|                 basicPrductRemak7=#{basicPrductRemak7}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak8 != null"> | ||||
|                 basicPrductRemak8=#{basicPrductRemak8}, | ||||
|             </if> | ||||
|         </trim> | ||||
|         WHERE nameCode = #{nameCode} | ||||
|           and uuid = #{uuid} | ||||
|     </update> | ||||
| 
 | ||||
|     <update id="updateUdiInfoByUuid" parameterType="com.glxp.api.entity.basic.UdiProductEntity"> | ||||
|         update basic_products | ||||
|         <trim prefix="set" suffixOverrides=","> | ||||
|             <if test="originUuid != null"> | ||||
|                 originUuid=#{originUuid}, | ||||
|             </if> | ||||
|             <if test="nameCode != null"> | ||||
|                 nameCode=#{nameCode}, | ||||
|             </if> | ||||
|             <if test="deviceRecordKey != null"> | ||||
|                 deviceRecordKey=#{deviceRecordKey}, | ||||
|             </if> | ||||
|             <if test="packRatio != null"> | ||||
|                 packRatio=#{packRatio}, | ||||
|             </if> | ||||
|             <if test="packLevel != null"> | ||||
|                 packLevel=#{packLevel}, | ||||
|             </if> | ||||
|             <if test="packUnit != null"> | ||||
|                 packUnit=#{packUnit}, | ||||
|             </if> | ||||
|             <if test="bhxjsl != null"> | ||||
|                 bhxjsl=#{bhxjsl}, | ||||
|             </if> | ||||
|             <if test="bhzxxsbzsl != null"> | ||||
|                 bhzxxsbzsl=#{bhzxxsbzsl}, | ||||
|             </if> | ||||
|             <if test="zxxsbzbhsydysl != null"> | ||||
|                 zxxsbzbhsydysl=#{zxxsbzbhsydysl}, | ||||
|             </if> | ||||
|             <if test="bhxjcpbm != null"> | ||||
|                 bhxjcpbm=#{bhxjcpbm}, | ||||
|             </if> | ||||
|             <if test="bzcj != null"> | ||||
|                 bzcj=#{bzcj}, | ||||
|             </if> | ||||
|             <if test="cpmctymc != null"> | ||||
|                 cpmctymc=#{cpmctymc}, | ||||
|             </if> | ||||
|             <if test="cplb != null"> | ||||
|                 cplb=#{cplb}, | ||||
|             </if> | ||||
|             <if test="flbm != null"> | ||||
|                 flbm=#{flbm}, | ||||
|             </if> | ||||
|             <if test="ggxh != null"> | ||||
|                 ggxh=#{ggxh}, | ||||
|             </if> | ||||
|             <if test="qxlb != null"> | ||||
|                 qxlb =#{qxlb}, | ||||
|             </if> | ||||
|             <if test="tyshxydm != null"> | ||||
|                 tyshxydm=#{tyshxydm}, | ||||
|             </if> | ||||
|             <if test="ylqxzcrbarmc != null"> | ||||
|                 ylqxzcrbarmc=#{ylqxzcrbarmc}, | ||||
|             </if> | ||||
|             <if test="zczbhhzbapzbh != null"> | ||||
|                 zczbhhzbapzbh=#{zczbhhzbapzbh}, | ||||
|             </if> | ||||
|             <if test="ylqxzcrbarywmc != null"> | ||||
|                 ylqxzcrbarywmc=#{ylqxzcrbarywmc}, | ||||
|             </if> | ||||
|             <if test="sydycpbs != null"> | ||||
|                 sydycpbs=#{sydycpbs}, | ||||
|             </if> | ||||
|             <if test="sjcpbm != null"> | ||||
|                 sjcpbm=#{sjcpbm}, | ||||
|             </if> | ||||
|             <if test="versionNumber != null"> | ||||
|                 versionNumber=#{versionNumber}, | ||||
|             </if> | ||||
|             <if test="diType != null"> | ||||
|                 diType=#{diType}, | ||||
|             </if> | ||||
|             <if test="ybbm != null"> | ||||
|                 ybbm=#{ybbm}, | ||||
|             </if> | ||||
|             <if test="sptm != null"> | ||||
|                 sptm=#{sptm}, | ||||
|             </if> | ||||
|             <if test="manufactory != null"> | ||||
|                 manufactory=#{manufactory}, | ||||
|             </if> | ||||
|             <if test="measname != null"> | ||||
|                 measname=#{measname}, | ||||
|             </if> | ||||
|             <if test="productType != null"> | ||||
|                 productType=#{productType}, | ||||
|             </if> | ||||
|             <if test="scbssfbhph != null"> | ||||
|                 scbssfbhph=#{scbssfbhph}, | ||||
|             </if> | ||||
|             <if test="scbssfbhxlh != null"> | ||||
|                 scbssfbhxlh=#{scbssfbhxlh}, | ||||
|             </if> | ||||
|             <if test="scbssfbhscrq != null"> | ||||
|                 scbssfbhscrq=#{scbssfbhscrq}, | ||||
|             </if> | ||||
|             <if test="scbssfbhsxrq != null"> | ||||
|                 scbssfbhsxrq=#{scbssfbhsxrq}, | ||||
|             </if> | ||||
|             <if test="cpms != null"> | ||||
|                 cpms=#{cpms}, | ||||
|             </if> | ||||
|             <if test="allowNoBatch != null"> | ||||
|                 allowNoBatch=#{allowNoBatch}, | ||||
|             </if> | ||||
|             <if test="allowNoExpire != null"> | ||||
|                 allowNoExpire=#{allowNoExpire}, | ||||
|             </if> | ||||
|             <if test="allowNoProduct != null"> | ||||
|                 allowNoProduct=#{allowNoProduct}, | ||||
|             </if> | ||||
|             <if test="allowNoSerial != null"> | ||||
|                 allowNoSerial=#{allowNoSerial}, | ||||
|             </if> | ||||
|             <if test="spmc != null"> | ||||
|                 spmc=#{spmc}, | ||||
|             </if> | ||||
|             <if test="cplx != null"> | ||||
|                 cplx=#{cplx}, | ||||
|             </if> | ||||
|             <if test="hchzsb != null"> | ||||
|                 hchzsb=#{hchzsb}, | ||||
|             </if> | ||||
|             <if test="cpdls != null"> | ||||
|                 cpdls=#{cpdls}, | ||||
|             </if> | ||||
|             <if test="price != null"> | ||||
|                 price=#{price}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak1 != null"> | ||||
|                 basicPrductRemak1=#{basicPrductRemak1}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak2 != null"> | ||||
|                 basicPrductRemak2=#{basicPrductRemak2}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak3 != null"> | ||||
|                 basicPrductRemak3=#{basicPrductRemak3}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak4 != null"> | ||||
|                 basicPrductRemak4=#{basicPrductRemak4}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak5 != null"> | ||||
|                 basicPrductRemak5=#{basicPrductRemak5}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak6 != null"> | ||||
|                 basicPrductRemak6=#{basicPrductRemak6}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak7 != null"> | ||||
|                 basicPrductRemak7=#{basicPrductRemak7}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak8 != null"> | ||||
|                 basicPrductRemak8=#{basicPrductRemak8}, | ||||
|             </if> | ||||
|         </trim> | ||||
|         where uuid = #{uuid} | ||||
|     </update> | ||||
| 
 | ||||
|     <update id="updateUdiInfoById" parameterType="com.glxp.api.entity.basic.UdiProductEntity"> | ||||
|         update basic_products | ||||
|         <trim prefix="set" suffixOverrides=","> | ||||
|             <if test="originUuid != null"> | ||||
|                 originUuid=#{originUuid}, | ||||
|             </if> | ||||
|             <if test="nameCode != null"> | ||||
|                 nameCode=#{nameCode}, | ||||
|             </if> | ||||
|             <if test="deviceRecordKey != null"> | ||||
|                 deviceRecordKey=#{deviceRecordKey}, | ||||
|             </if> | ||||
|             <if test="packRatio != null"> | ||||
|                 packRatio=#{packRatio}, | ||||
|             </if> | ||||
|             <if test="packLevel != null"> | ||||
|                 packLevel=#{packLevel}, | ||||
|             </if> | ||||
|             <if test="packUnit != null"> | ||||
|                 packUnit=#{packUnit}, | ||||
|             </if> | ||||
|             <if test="bhxjsl != null"> | ||||
|                 bhxjsl=#{bhxjsl}, | ||||
|             </if> | ||||
|             <if test="bhzxxsbzsl != null"> | ||||
|                 bhzxxsbzsl=#{bhzxxsbzsl}, | ||||
|             </if> | ||||
|             <if test="zxxsbzbhsydysl != null"> | ||||
|                 zxxsbzbhsydysl=#{zxxsbzbhsydysl}, | ||||
|             </if> | ||||
|             <if test="bhxjcpbm != null"> | ||||
|                 bhxjcpbm=#{bhxjcpbm}, | ||||
|             </if> | ||||
|             <if test="bzcj != null"> | ||||
|                 bzcj=#{bzcj}, | ||||
|             </if> | ||||
|             <if test="cpmctymc != null"> | ||||
|                 cpmctymc=#{cpmctymc}, | ||||
|             </if> | ||||
|             <if test="cplb != null"> | ||||
|                 cplb=#{cplb}, | ||||
|             </if> | ||||
|             <if test="flbm != null"> | ||||
|                 flbm=#{flbm}, | ||||
|             </if> | ||||
|             <if test="ggxh != null"> | ||||
|                 ggxh=#{ggxh}, | ||||
|             </if> | ||||
|             <if test="qxlb != null"> | ||||
|                 qxlb =#{qxlb}, | ||||
|             </if> | ||||
|             <if test="tyshxydm != null"> | ||||
|                 tyshxydm=#{tyshxydm}, | ||||
|             </if> | ||||
|             <if test="ylqxzcrbarmc != null"> | ||||
|                 ylqxzcrbarmc=#{ylqxzcrbarmc}, | ||||
|             </if> | ||||
|             <if test="zczbhhzbapzbh != null"> | ||||
|                 zczbhhzbapzbh=#{zczbhhzbapzbh}, | ||||
|             </if> | ||||
|             <if test="ylqxzcrbarywmc != null"> | ||||
|                 ylqxzcrbarywmc=#{ylqxzcrbarywmc}, | ||||
|             </if> | ||||
|             <if test="sydycpbs != null"> | ||||
|                 sydycpbs=#{sydycpbs}, | ||||
|             </if> | ||||
|             <if test="sjcpbm != null"> | ||||
|                 sjcpbm=#{sjcpbm}, | ||||
|             </if> | ||||
|             <if test="versionNumber != null"> | ||||
|                 versionNumber=#{versionNumber}, | ||||
|             </if> | ||||
|             <if test="diType != null"> | ||||
|                 diType=#{diType}, | ||||
|             </if> | ||||
|             <if test="ybbm != null"> | ||||
|                 ybbm=#{ybbm}, | ||||
|             </if> | ||||
|             <if test="sptm != null"> | ||||
|                 sptm=#{sptm}, | ||||
|             </if> | ||||
|             <if test="manufactory != null"> | ||||
|                 manufactory=#{manufactory}, | ||||
|             </if> | ||||
|             <if test="measname != null"> | ||||
|                 measname=#{measname}, | ||||
|             </if> | ||||
|             <if test="productType != null"> | ||||
|                 productType=#{productType}, | ||||
|             </if> | ||||
|             <if test="scbssfbhph != null"> | ||||
|                 scbssfbhph=#{scbssfbhph}, | ||||
|             </if> | ||||
|             <if test="scbssfbhxlh != null"> | ||||
|                 scbssfbhxlh=#{scbssfbhxlh}, | ||||
|             </if> | ||||
|             <if test="scbssfbhscrq != null"> | ||||
|                 scbssfbhscrq=#{scbssfbhscrq}, | ||||
|             </if> | ||||
|             <if test="scbssfbhsxrq != null"> | ||||
|                 scbssfbhsxrq=#{scbssfbhsxrq}, | ||||
|             </if> | ||||
|             <if test="cpms != null"> | ||||
|                 cpms=#{cpms}, | ||||
|             </if> | ||||
|             <if test="allowNoBatch != null"> | ||||
|                 allowNoBatch=#{allowNoBatch}, | ||||
|             </if> | ||||
|             <if test="allowNoExpire != null"> | ||||
|                 allowNoExpire=#{allowNoExpire}, | ||||
|             </if> | ||||
|             <if test="allowNoProduct != null"> | ||||
|                 allowNoProduct=#{allowNoProduct}, | ||||
|             </if> | ||||
|             <if test="allowNoSerial != null"> | ||||
|                 allowNoSerial=#{allowNoSerial}, | ||||
|             </if> | ||||
|             <if test="spmc != null"> | ||||
|                 spmc=#{spmc}, | ||||
|             </if> | ||||
|             <if test="cplx != null"> | ||||
|                 cplx=#{cplx}, | ||||
|             </if> | ||||
|             <if test="hchzsb != null"> | ||||
|                 hchzsb=#{hchzsb}, | ||||
|             </if> | ||||
|             <if test="cpdls != null"> | ||||
|                 cpdls=#{cpdls}, | ||||
|             </if> | ||||
|             <if test="price != null"> | ||||
|                 price=#{price}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak1 != null"> | ||||
|                 basicPrductRemak1=#{basicPrductRemak1}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak2 != null"> | ||||
|                 basicPrductRemak2=#{basicPrductRemak2}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak3 != null"> | ||||
|                 basicPrductRemak3=#{basicPrductRemak3}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak4 != null"> | ||||
|                 basicPrductRemak4=#{basicPrductRemak4}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak5 != null"> | ||||
|                 basicPrductRemak5=#{basicPrductRemak5}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak6 != null"> | ||||
|                 basicPrductRemak6=#{basicPrductRemak6}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak7 != null"> | ||||
|                 basicPrductRemak7=#{basicPrductRemak7}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak8 != null"> | ||||
|                 basicPrductRemak8=#{basicPrductRemak8}, | ||||
|             </if> | ||||
|         </trim> | ||||
|         where id = #{id} | ||||
|     </update> | ||||
| 
 | ||||
|     <select id="batchSelectByUuid" resultType="com.glxp.api.entity.basic.UdiProductEntity"> | ||||
|         select * | ||||
|         from basic_products where uuid in | ||||
|         <foreach collection="uuids" item="item" separator="," index="index" open="(" close=")"> | ||||
|             #{item} | ||||
|         </foreach> | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <select id="batchSelectByOriginUuid" resultType="com.glxp.api.entity.basic.UdiRelevanceEntity"> | ||||
|         select * | ||||
|         from basic_products where originUuid in | ||||
|         <foreach collection="uuids" item="item" index="index" separator="," open="(" close=")"> | ||||
|             #{item} | ||||
|         </foreach> | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="selectPackLevel" resultType="java.lang.Integer"> | ||||
|         select packLevel | ||||
|         from basic_products | ||||
|         where nameCode = #{nameCode} | ||||
|         limit 1 | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="selectGgxhList" resultType="java.lang.String"> | ||||
|         select distinct ggxh | ||||
|         from basic_products | ||||
|                      left join basic_udirel on basic_products.uuid = basic_udirel.uuid | ||||
|         where basic_udirel.id = #{relId} | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <update id="updateUdiInfoNotAll" parameterType="com.glxp.api.req.basic.UdiInfoRequest"> | ||||
|         UPDATE basic_products | ||||
|         <trim prefix="set" suffixOverrides=","> | ||||
|             <if test="packRatio != null"> | ||||
|                 packRatio=#{packRatio}, | ||||
|             </if> | ||||
|             <if test="packLevel != null"> | ||||
|                 packLevel=#{packLevel}, | ||||
|             </if> | ||||
|             <if test="bhxjsl != null"> | ||||
|                 bhxjsl=#{bhxjsl}, | ||||
|             </if> | ||||
|             <if test="bhzxxsbzsl != null"> | ||||
|                 bhzxxsbzsl=#{bhzxxsbzsl}, | ||||
|             </if> | ||||
|             <if test="zxxsbzbhsydysl != null"> | ||||
|                 zxxsbzbhsydysl=#{zxxsbzbhsydysl}, | ||||
|             </if> | ||||
|             <if test="bhxjcpbm != null"> | ||||
|                 bhxjcpbm=#{bhxjcpbm}, | ||||
|             </if> | ||||
|             <if test="bzcj != null"> | ||||
|                 bzcj=#{bzcj}, | ||||
|             </if> | ||||
|             <if test="addType != null"> | ||||
|                 addType=#{addType}, | ||||
|             </if> | ||||
|             <if test="deviceRecordKey != null"> | ||||
|                 deviceRecordKey=#{deviceRecordKey}, | ||||
|             </if> | ||||
|             <if test="cpmctymc != null"> | ||||
|                 cpmctymc=#{cpmctymc}, | ||||
|             </if> | ||||
|             <if test="cplb != null"> | ||||
|                 cplb=#{cplb}, | ||||
|             </if> | ||||
|             <if test="flbm != null"> | ||||
|                 flbm=#{flbm}, | ||||
|             </if> | ||||
|             <if test="ggxh != null"> | ||||
|                 ggxh=#{ggxh}, | ||||
|             </if> | ||||
|             <if test="qxlb != null"> | ||||
|                 qxlb=#{qxlb}, | ||||
|             </if> | ||||
|             <if test="tyshxydm != null"> | ||||
|                 tyshxydm=#{tyshxydm}, | ||||
|             </if> | ||||
|             <if test="ylqxzcrbarmc != null"> | ||||
|                 ylqxzcrbarmc=#{ylqxzcrbarmc}, | ||||
|             </if> | ||||
|             <if test="ylqxzcrbarywmc != null"> | ||||
|                 ylqxzcrbarywmc=#{ylqxzcrbarywmc}, | ||||
|             </if> | ||||
|             <if test="uuid != null"> | ||||
|                 uuid=#{uuid}, | ||||
|             </if> | ||||
|             <if test="sjcpbm != null"> | ||||
|                 sjcpbm=#{sjcpbm}, | ||||
|             </if> | ||||
|             <if test="versionNumber != null"> | ||||
|                 versionNumber=#{versionNumber}, | ||||
|             </if> | ||||
|             <if test="sptm != null"> | ||||
|                 sptm=#{sptm}, | ||||
|             </if> | ||||
|             <if test="manufactory != null"> | ||||
|                 manufactory=#{manufactory}, | ||||
|             </if> | ||||
|             <if test="ybbm != null"> | ||||
|                 ybbm=#{ybbm}, | ||||
|             </if> | ||||
|             <if test="measname != null"> | ||||
|                 measname=#{measname}, | ||||
|             </if> | ||||
|             <if test="diType != null"> | ||||
|                 diType=#{diType}, | ||||
|             </if> | ||||
|             <if test="productType != null"> | ||||
|                 productType=#{productType}, | ||||
|             </if> | ||||
|             <if test="scbssfbhph != null"> | ||||
|                 scbssfbhph=#{scbssfbhph}, | ||||
|             </if> | ||||
|             <if test="scbssfbhxlh != null"> | ||||
|                 scbssfbhxlh=#{scbssfbhxlh}, | ||||
|             </if> | ||||
|             <if test="scbssfbhscrq != null"> | ||||
|                 scbssfbhscrq=#{scbssfbhscrq}, | ||||
|             </if> | ||||
|             <if test="scbssfbhsxrq != null"> | ||||
|                 scbssfbhsxrq=#{scbssfbhsxrq}, | ||||
|             </if> | ||||
|             <if test="cpms != null"> | ||||
|                 cpms=#{cpms}, | ||||
|             </if> | ||||
|             <if test="originUuid != null"> | ||||
|                 originUuid=#{originUuid}, | ||||
|             </if> | ||||
|             <if test="spmc != null"> | ||||
|                 spmc=#{spmc}, | ||||
|             </if> | ||||
|             <if test="cpdls != null"> | ||||
|                 cpdls=#{cpdls}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak1 != null"> | ||||
|                 basicPrductRemak1=#{basicPrductRemak1}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak2 != null"> | ||||
|                 basicPrductRemak2=#{basicPrductRemak2}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak3 != null"> | ||||
|                 basicPrductRemak3=#{basicPrductRemak3}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak4 != null"> | ||||
|                 basicPrductRemak4=#{basicPrductRemak4}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak5 != null"> | ||||
|                 basicPrductRemak5=#{basicPrductRemak5}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak6 != null"> | ||||
|                 basicPrductRemak6=#{basicPrductRemak6}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak7 != null"> | ||||
|                 basicPrductRemak7=#{basicPrductRemak7}, | ||||
|             </if> | ||||
|             <if test="basicPrductRemak8 != null"> | ||||
|                 basicPrductRemak8=#{basicPrductRemak8}, | ||||
|             </if> | ||||
|         </trim> | ||||
|         WHERE uuid = #{uuid} | ||||
|     </update> | ||||
| 
 | ||||
|     <select id="selectAllowNoBatch" resultType="com.glxp.api.entity.basic.UdiProductEntity"> | ||||
|         select id, allowNoBatch | ||||
|         from basic_products | ||||
|         where nameCode = #{nameCode} | ||||
|         limit 1 | ||||
|     </select> | ||||
| </mapper> | ||||
											
												
													File diff suppressed because it is too large
													Load Diff
												
											
										
									
								| @ -1,369 +0,0 @@ | ||||
| <?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.basic.UdiRlSupDao"> | ||||
|     <select id="filterCompanyProductRelevance" | ||||
|             parameterType="com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest" | ||||
|             resultType="com.glxp.api.entity.basic.UdiRlSupEntity"> | ||||
|         select * | ||||
|         from company_product_relevance | ||||
|         <where> | ||||
|             <if test="customerId != '' and customerId != null"> | ||||
|                 and customerId = #{customerId} | ||||
|             </if> | ||||
|             <if test="udiRlIdFk != '' and udiRlIdFk != null"> | ||||
|                 and udiRlIdFk = #{udiRlIdFk} | ||||
|             </if> | ||||
|             <if test="unitFk != null and unitFk != ''"> | ||||
|                 and unitFk = #{unitFk} | ||||
|             </if> | ||||
|             <if test="lastUpdateTime != null and lastUpdateTime != ''"> | ||||
|                 <![CDATA[ | ||||
|                 and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') | ||||
|                 ]]> | ||||
|             </if> | ||||
|         </where> | ||||
|         ORDER BY id DESC | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <select id="filterUdiGp" parameterType="com.glxp.api.req.basic.CompanyProductRelevanceRequest" | ||||
|             resultType="com.glxp.api.res.basic.UdiRlSupResponse"> | ||||
|         select company_product_relevance.id, | ||||
|         company_product_relevance.customerId, | ||||
|         company_product_relevance.auditStatus, | ||||
|         company_product_relevance.price, | ||||
|         basic_udirel.uuid, | ||||
|         basic_udirel.thirdId, | ||||
|         basic_udirel.id      rlId, | ||||
|         basic_udirel.isUseDy, | ||||
|         basic_udirel.useMuti, | ||||
|         basic_udirel.isLock, | ||||
|         basic_udirel.thirdId1, | ||||
|         basic_udirel.thirdId2, | ||||
|         basic_udirel.thirdId3, | ||||
|         basic_udirel.thirdId4, | ||||
|         basic_udirel.lockStatus, | ||||
|         basic_udirel.mainId, | ||||
|         basic_udirel.isAdavence, | ||||
| 
 | ||||
|         basic_udirel.lowStockNum, | ||||
|         basic_udirel.overStockNum, | ||||
|         basic_udirel.recentDateTime, | ||||
|         basic_udirel.isDateBy, | ||||
| 
 | ||||
| 
 | ||||
|         bht.name             classifyName, | ||||
|         basic_products.id as PRId, | ||||
|         basic_products.originUuid, | ||||
|         basic_products.nameCode, | ||||
|         basic_products.deviceRecordKey, | ||||
|         basic_products.packRatio, | ||||
|         basic_products.packUnit, | ||||
|         basic_products.packLevel, | ||||
|         basic_products.bhxjsl, | ||||
|         basic_products.bhzxxsbzsl, | ||||
|         basic_products.zxxsbzbhsydysl, | ||||
|         basic_products.bhxjcpbm, | ||||
|         basic_products.bzcj, | ||||
|         basic_products.cpmctymc, | ||||
|         basic_products.cplb, | ||||
|         basic_products.flbm, | ||||
|         basic_products.ggxh, | ||||
|         basic_products.qxlb, | ||||
|         basic_products.tyshxydm, | ||||
|         basic_products.ylqxzcrbarmc, | ||||
|         basic_products.zczbhhzbapzbh, | ||||
|         basic_products.ylqxzcrbarywmc, | ||||
|         basic_products.sydycpbs, | ||||
|         basic_products.sjcpbm, | ||||
|         basic_products.versionNumber, | ||||
|         basic_products.diType, | ||||
|         basic_products.ybbm, | ||||
|         basic_products.sptm, | ||||
|         basic_products.manufactory, | ||||
|         basic_products.measname, | ||||
|         basic_products.productType, | ||||
|         basic_products.scbssfbhph, | ||||
|         basic_products.scbssfbhxlh, | ||||
|         basic_products.scbssfbhscrq, | ||||
|         basic_products.scbssfbhsxrq, | ||||
|         basic_products.cpms, | ||||
|         basic_products.allowNoBatch, | ||||
|         basic_products.allowNoExpire, | ||||
|         basic_products.allowNoProduct, | ||||
|         basic_products.allowNoSerial, | ||||
|         basic_products.spmc, | ||||
|         basic_products.cplx, | ||||
|         basic_products.hchzsb, | ||||
|         basic_products.cpdls, | ||||
|         basic_products.basicPrductRemak1, | ||||
|         basic_products.basicPrductRemak2, | ||||
|         basic_products.basicPrductRemak3, | ||||
|         basic_products.basicPrductRemak4, | ||||
|         basic_products.basicPrductRemak5, | ||||
|         basic_products.basicPrductRemak6, | ||||
|         basic_products.basicPrductRemak7, | ||||
|         basic_products.basicPrductRemak8, | ||||
|         basic_corp.name      companyName | ||||
|         FROM company_product_relevance | ||||
|         inner JOIN basic_udirel | ||||
|         ON company_product_relevance.udiRlIdFk = basic_udirel.id | ||||
|         inner JOIN basic_products | ||||
|         ON basic_udirel.uuid = basic_products.uuid | ||||
|         left JOIN basic_corp on basic_corp.erpId = company_product_relevance.customerId | ||||
|         left join basic_hosp_type bht on basic_udirel.relCode = bht.code | ||||
|         <where> | ||||
|             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null"> | ||||
|                 AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc}, '%') | ||||
|             </if> | ||||
|             <if test="cpmctymc != '' and cpmctymc != null"> | ||||
|                 AND cpmctymc LIKE concat(#{cpmctymc}, '%') | ||||
|             </if> | ||||
|             <if test="nameCode != '' and nameCode != null"> | ||||
|                 AND nameCode LIKE concat(#{nameCode}, '%') | ||||
|             </if> | ||||
|             <if test="ggxh != '' and ggxh != null"> | ||||
|                 AND ggxh LIKE concat('%', #{ggxh}, '%') | ||||
|             </if> | ||||
|             <if test="unionCode != '' and unionCode != null"> | ||||
|                 and ( | ||||
|                 nameCode LIKE concat('%', #{unionCode}, '%') | ||||
|                 or basic_products.ybbm LIKE concat('%', #{unionCode}, '%') | ||||
|                 or basic_products.sptm LIKE concat('%', #{unionCode}, '%') | ||||
|                 ) | ||||
|             </if> | ||||
|             <if test="thrPiId != '' and thrPiId != null"> | ||||
|                 and ( | ||||
|                 basic_udirel.thirdId LIKE concat('%', #{thrPiId}, '%') | ||||
|                 or basic_udirel.thirdId1 LIKE concat('%', #{thrPiId}, '%') | ||||
|                 or basic_udirel.thirdId2 LIKE concat('%', #{thrPiId}, '%') | ||||
|                 or basic_udirel.thirdId3 LIKE concat('%', #{thrPiId}, '%') | ||||
|                 or basic_udirel.thirdId4 LIKE concat('%', #{thrPiId}, '%') | ||||
|                 ) | ||||
|             </if> | ||||
|             <if test="uuid != '' and uuid != null"> | ||||
|                 AND basic_udirel.uuid = #{uuid} | ||||
|             </if> | ||||
|             <if test="thirdId != '' and thirdId != null"> | ||||
|                 AND basic_udirel.thirdId = #{thirdId} | ||||
|             </if> | ||||
|             <if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null"> | ||||
|                 AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh}, '%') | ||||
|             </if> | ||||
|             <if test="diType != '' and diType != null"> | ||||
|                 AND diType = #{diType} | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 1"> | ||||
|                 AND (basic_udirel.thirdId <![CDATA[<>]]> '' or basic_udirel.thirdId1 <![CDATA[<>]]> '' or | ||||
|                 basic_udirel.thirdId2 <![CDATA[<>]]> '' or | ||||
|                 basic_udirel.thirdId3 <![CDATA[<>]]> '' or basic_udirel.thirdId4 <![CDATA[<>]]> '') | ||||
|                 and basic_products.originUuid <![CDATA[<>]]> '' | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 2"> | ||||
|                 AND basic_products.originUuid is NULL | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 3"> | ||||
|                 AND (basic_udirel.thirdId IS NULL or basic_udirel.thirdId='') | ||||
|                 and basic_products.originUuid <![CDATA[<>]]> '' | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 4"> | ||||
|                 AND basic_udirel.thirdId1 is NULL | ||||
|                 and basic_products.originUuid <![CDATA[<>]]> '' | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 5"> | ||||
|                 AND basic_udirel.thirdId2 is NULL | ||||
|                 and basic_products.originUuid <![CDATA[<>]]> '' | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 6"> | ||||
|                 AND basic_udirel.thirdId3 is NULL | ||||
|                 and basic_products.originUuid <![CDATA[<>]]> '' | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 7"> | ||||
|                 AND basic_udirel.thirdId4 is NULL | ||||
|                 and basic_products.originUuid <![CDATA[<>]]> '' | ||||
|             </if> | ||||
|             <if test="filterType != null and filterType == 10"> | ||||
|                 AND basic_udirel.updateTime is NULL | ||||
|             </if> | ||||
| 
 | ||||
|             <if test="customerId != '' and customerId != null"> | ||||
|                 AND company_product_relevance.customerId = #{customerId} | ||||
|             </if> | ||||
|             <if test="auditStatus != '' and auditStatus != null"> | ||||
|                 AND company_product_relevance.auditStatus = #{auditStatus} | ||||
|             </if> | ||||
|             <if test="id != '' and id != null"> | ||||
|                 AND basic_udirel.id = #{id} | ||||
|             </if> | ||||
|             <if test="companyName != '' and companyName != null"> | ||||
|                 AND basic_corp.name = #{companyName} | ||||
|             </if> | ||||
|             <if test="lockStatus != '' and lockStatus != null"> | ||||
|                 AND basic_udirel.lockStatus = #{lockStatus} | ||||
|             </if> | ||||
|             <if test="isAdavence != '' and isAdavence != null"> | ||||
|                 AND basic_udirel.isAdavence = #{isAdavence} | ||||
|             </if> | ||||
|             <if test="unitFk != null and unitFk != ''"> | ||||
|                 and unitFk = #{unitFk} | ||||
|             </if> | ||||
|             <if test="isDisable == false"> | ||||
|                 AND (basic_udirel.isDisable is null or basic_udirel.isDisable = false) | ||||
|             </if> | ||||
|         </where> | ||||
|         ORDER BY company_product_relevance.updateTime DESC | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <select id="findCompanyProductRelevance" parameterType="java.lang.Long" | ||||
|             resultType="com.glxp.api.entity.basic.UdiRlSupEntity"> | ||||
|         SELECT * | ||||
|         FROM company_product_relevance | ||||
|         where customerId = #{customerId} | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="findCompanyProductRelevanceByProductId" parameterType="java.lang.String" | ||||
|             resultType="com.glxp.api.entity.basic.UdiRlSupEntity"> | ||||
|         SELECT * | ||||
|         FROM company_product_relevance | ||||
|         where productId = #{productId} | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="findCompanyProductRelevanceByUdiRlIdFk" parameterType="java.lang.String" | ||||
|             resultType="com.glxp.api.entity.basic.UdiRlSupEntity"> | ||||
|         SELECT * | ||||
|         FROM company_product_relevance | ||||
|         where udiRlIdFk = #{udiRlIdFk} | ||||
|         and customerId = #{customerId} | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <select id="findCompanyProductRelevanceByProductUuid" | ||||
|             parameterType="com.glxp.api.entity.basic.UdiRlSupEntity" | ||||
|             resultType="com.glxp.api.entity.basic.UdiRlSupEntity"> | ||||
|         SELECT * | ||||
|         FROM company_product_relevance | ||||
|         <where> | ||||
|             <if test="customerId != null and customerId != ''"> | ||||
|                 and customerId = #{customerId} | ||||
|             </if> | ||||
|             <if test="productId != null and productId != ''"> | ||||
|                 and productId = #{productId} | ||||
|             </if> | ||||
|             <if test="productUuid != null and productUuid != ''"> | ||||
|                 and productUuid = #{productUuid} | ||||
|             </if> | ||||
|             <if test="unitFk != null and unitFk != ''"> | ||||
|                 and unitFk = #{unitFk} | ||||
|             </if> | ||||
|         </where> | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="getCompanyProductRelevance" | ||||
|             parameterType="com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest" | ||||
|             resultType="com.glxp.api.entity.basic.UdiRlSupEntity"> | ||||
|         SELECT * | ||||
|         FROM company_product_relevance | ||||
|         <where> | ||||
|             <if test="customerId != null and customerId != ''"> | ||||
|                 and customerId = #{customerId} | ||||
|             </if> | ||||
|             <if test="productId != null and productId != ''"> | ||||
|                 and productId = #{productId} | ||||
|             </if> | ||||
|             <if test="productUuid != null and productUuid != ''"> | ||||
|                 and productUuid = #{productUuid} | ||||
|             </if> | ||||
|             <if test="unitFk != null and unitFk != ''"> | ||||
|                 and unitFk = #{unitFk} | ||||
|             </if> | ||||
|         </where> | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <insert id="insertCompanyProductRelevance" | ||||
|             parameterType="com.glxp.api.entity.basic.UdiRlSupEntity"> | ||||
|         replace | ||||
|         INTO company_product_relevance(id,customerId, productId, enterpriseId, registrationId, | ||||
|         createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk, | ||||
|         price, createUser, updateUser) | ||||
|         values (#{id},#{customerId}, | ||||
|         #{productId}, | ||||
|         #{enterpriseId}, | ||||
|         #{registrationId}, | ||||
|         #{createTime}, | ||||
|         #{updateTime}, | ||||
|         #{auditStatus}, | ||||
|         #{productUuid}, | ||||
|         #{udiRlIdFk}, | ||||
|         #{unitFk}, | ||||
|         #{price}, | ||||
|         #{createUser}, | ||||
|         #{updateUser}) | ||||
|     </insert> | ||||
| 
 | ||||
| 
 | ||||
|     <insert id="importCompanyProductRelevance" | ||||
|             parameterType="com.glxp.api.entity.basic.UdiRlSupEntity"> | ||||
|         replace | ||||
|         INTO company_product_relevance(id, customerId, productId, enterpriseId, registrationId, | ||||
|         createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk, | ||||
|         price, createUser, updateUser) | ||||
|         values (#{id}, | ||||
|         #{customerId}, | ||||
|         #{productId}, | ||||
|         #{enterpriseId}, | ||||
|         #{registrationId}, | ||||
|         #{createTime}, | ||||
|         #{updateTime}, | ||||
|         #{auditStatus}, | ||||
|         #{productUuid}, | ||||
|         #{udiRlIdFk}, | ||||
|         #{unitFk}, | ||||
|         #{price}, | ||||
|         #{createUser}, | ||||
|         #{updateUser}) | ||||
|     </insert> | ||||
| 
 | ||||
|     <delete id="deleteById" parameterType="Map"> | ||||
|         DELETE | ||||
|         FROM company_product_relevance | ||||
|         WHERE id = #{id} | ||||
|     </delete> | ||||
| 
 | ||||
| 
 | ||||
|     <delete id="deleteByRlId" parameterType="Map"> | ||||
|         DELETE | ||||
|         FROM company_product_relevance | ||||
|         WHERE udiRlIdFk = #{id} | ||||
|     </delete> | ||||
| 
 | ||||
|     <select id="selectUnitFkByUdiRlIdFk" resultType="java.lang.String"> | ||||
|         select unitFk | ||||
|         from company_product_relevance | ||||
|         where udiRlIdFk = #{udiRlIdFk} | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="selectUnitFkByRelId" resultType="java.lang.String"> | ||||
|         select unitFk | ||||
|         from company_product_relevance | ||||
|         where udiRlIdFk = #{relId} | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="selectSupRlCount" resultType="java.lang.Long"> | ||||
|         select count(*) | ||||
|         FROM company_product_relevance | ||||
|         inner JOIN basic_udirel | ||||
|         ON company_product_relevance.udiRlIdFk = basic_udirel.id | ||||
|         inner JOIN basic_products ON basic_udirel.uuid = basic_products.uuid | ||||
|         <where> | ||||
|             <if test="nameCode != '' and nameCode != null"> | ||||
|                 AND nameCode LIKE concat(#{nameCode}, '%') | ||||
|             </if> | ||||
|             <if test="unitFk != null and unitFk != ''"> | ||||
|                 and unitFk = #{unitFk} | ||||
|             </if> | ||||
|         </where> | ||||
|     </select> | ||||
| </mapper> | ||||
					Loading…
					
					
				
		Reference in New Issue