UDI数据同步,第三方产品信息新增,审核等;手持终端登记审核;
parent
5736662672
commit
5f715c67f6
@ -0,0 +1,118 @@
|
||||
package com.glxp.sale.admin.controller.thrsys;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.sale.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity;
|
||||
import com.glxp.sale.admin.entity.thrsys.ThrProductsEntity;
|
||||
import com.glxp.sale.admin.req.info.DeleteRequest;
|
||||
import com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest;
|
||||
import com.glxp.sale.admin.res.PageSimpleResponse;
|
||||
import com.glxp.sale.admin.service.auth.CustomerService;
|
||||
import com.glxp.sale.admin.service.thrsys.ThrProductsAddService;
|
||||
import com.glxp.sale.admin.service.thrsys.ThrProductsService;
|
||||
import com.glxp.sale.admin.util.BeanUtils;
|
||||
import com.glxp.sale.common.enums.ResultEnum;
|
||||
import com.glxp.sale.common.res.BaseResponse;
|
||||
import com.glxp.sale.common.util.ResultVOUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class ThrProductsAddController {
|
||||
@Resource
|
||||
private ThrProductsAddService thrProductsAddService;
|
||||
@Resource
|
||||
private ThrProductsService thrProductsService;
|
||||
@Resource
|
||||
private CustomerService customerService;
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/udiwms/thrsys/getThrAddProducts")
|
||||
public BaseResponse getThrProducts(FilterThrProductsRequest filterThrProductsRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
Long customerId = customerService.getCustomerId();
|
||||
if (customerId != 110) {
|
||||
filterThrProductsRequest.setCustomerId(customerId + "");
|
||||
}
|
||||
List<ThrProductsAddEntity> thrProductsAddEntities
|
||||
= thrProductsAddService.filterThrProductsRequest(filterThrProductsRequest);
|
||||
PageInfo<ThrProductsAddEntity> pageInfo;
|
||||
pageInfo = new PageInfo<>(thrProductsAddEntities);
|
||||
PageSimpleResponse<ThrProductsAddEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(thrProductsAddEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udiwms/thrsys/delThrAddProducts")
|
||||
public BaseResponse delThrProducts(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
String id = deleteRequest.getId();
|
||||
thrProductsAddService.deleteById(id);
|
||||
return ResultVOUtils.success("删除成功");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udiwms/thrsys/updateThrAddProducts")
|
||||
public BaseResponse updateThrAddProducts(@RequestBody ThrProductsAddEntity thrProductsAddEntity, BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
thrProductsAddService.updateThrProducts(thrProductsAddEntity);
|
||||
if (thrProductsAddEntity.getCheckStatus() == 2) {
|
||||
ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
|
||||
thrProductsAddEntity = thrProductsAddService.selectById(thrProductsAddEntity.getId() + "");
|
||||
BeanUtils.copyProperties(thrProductsAddEntity, thrProductsEntity);
|
||||
thrProductsService.insertThrProducts(thrProductsEntity);
|
||||
}
|
||||
return ResultVOUtils.success("删除成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增第三方产品信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udiwms/thrsys/addThrAddProducts")
|
||||
public BaseResponse saveProduct(@RequestBody ThrProductsAddEntity thrProductsAddEntity) {
|
||||
if (null == thrProductsAddEntity)
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
|
||||
String customerId = customerService.getCustomerId() + "";
|
||||
if (customerId.equals("110")) {
|
||||
ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
|
||||
BeanUtils.copyProperties(thrProductsAddEntity, thrProductsEntity);
|
||||
thrProductsService.insertThrProducts(thrProductsEntity);
|
||||
|
||||
} else {
|
||||
if (StrUtil.isEmpty(thrProductsAddEntity.getThirdSysFk())) {
|
||||
thrProductsAddEntity.setThirdSysFk("thirdId");
|
||||
}
|
||||
thrProductsAddEntity.setCustomerId(customerId);
|
||||
thrProductsAddEntity.setCheckStatus(1);
|
||||
thrProductsAddService.insertThrProducts(thrProductsAddEntity);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.glxp.sale.admin.dao.basic;
|
||||
|
||||
import com.glxp.sale.admin.entity.basic.UdiCompanyEntity;
|
||||
import com.glxp.sale.admin.entity.udid.Contactlist;
|
||||
import com.glxp.sale.admin.req.basic.UdiCompanyRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface UdiCompanyDao {
|
||||
|
||||
List<UdiCompanyEntity> selectAllTyshxyh();
|
||||
|
||||
List<Contactlist> selectContactBykey(@Param("deviceRecordKey") String deviceRecordKey);
|
||||
|
||||
List<UdiCompanyEntity> filterUdiCompany(UdiCompanyRequest udiCompanyRequest);
|
||||
|
||||
boolean insertUdiCompany(UdiCompanyEntity udiCompanyEntity);
|
||||
|
||||
boolean insertUdiCompanys(@Param("udiCompanyEntities") List<UdiCompanyEntity> udiCompanyEntities);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteAll(@Param("ids") List<String> ids);
|
||||
|
||||
boolean updateUdiCompany(UdiCompanyEntity udiCompanyEntity);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.glxp.sale.admin.dao.thrsys;
|
||||
|
||||
import com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity;
|
||||
import com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ThrProductsAddDao {
|
||||
|
||||
List<ThrProductsAddEntity> filterThrProductsRequest(FilterThrProductsRequest filterThrProductsRequest);
|
||||
|
||||
List<ThrProductsAddEntity> batchSelectByIds(FilterThrProductsRequest filterThrProductsRequest);
|
||||
|
||||
ThrProductsAddEntity selectById(@Param("id") String id);
|
||||
|
||||
List<ThrProductsAddEntity> selectThrProducts(FilterThrProductsRequest filterThrProductsRequest);
|
||||
|
||||
boolean insertThrProducts(ThrProductsAddEntity thrProductsEntity);
|
||||
|
||||
boolean insertThrProductss(@Param("thrProductsEntities") List<ThrProductsAddEntity> thrProductsEntities);
|
||||
|
||||
boolean updateThrProducts(ThrProductsAddEntity thrProductsEntity);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteAll();
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.glxp.sale.admin.entity.thrsys;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class ThrProductsAddEntity {
|
||||
|
||||
private Integer id;
|
||||
private String code;
|
||||
private String name;
|
||||
private String measname;
|
||||
private String spec;
|
||||
private String registerNo;
|
||||
private String manufactory;
|
||||
private String thirdSysFk;
|
||||
private String cplb;
|
||||
private String flbm;
|
||||
private String qxlb;
|
||||
private String ybbm;
|
||||
private String sptm;
|
||||
private String tyshxydm;
|
||||
private String zczbhhzbapzbh;
|
||||
private String ylqxzcrbarmc;
|
||||
private String ylqxzcrbarywmc;
|
||||
private String cpms;
|
||||
private Date updateTime;
|
||||
private String supName;
|
||||
private boolean isChecked;
|
||||
|
||||
//添加字段
|
||||
private String model; //型号
|
||||
private String standard; //规格型号,二合一字段
|
||||
private String qtbm; //其他编码
|
||||
private String zczyxqz; //注册有效期截止时间
|
||||
private String remark; //备注
|
||||
private String remark1; //备注1
|
||||
private String remark2; //备注2
|
||||
private String remark3; //备注3
|
||||
private Integer checkStatus;
|
||||
private String customerId;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.glxp.sale.admin.req.basic;
|
||||
|
||||
import com.glxp.sale.admin.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UdiCompanyRequest extends ListPageRequest {
|
||||
|
||||
private String ylqxzcrbarmc;
|
||||
private String tyshxydm;
|
||||
private String provinceCode;
|
||||
private String cityCode;
|
||||
private String areaCode;
|
||||
|
||||
}
|
@ -1,42 +1,15 @@
|
||||
package com.glxp.sale.admin.res.inout;
|
||||
|
||||
import com.glxp.sale.admin.entity.receipt.ProductInfoEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ProductInfoResponse {
|
||||
|
||||
private Integer id;
|
||||
private String type;
|
||||
private String unit;
|
||||
private String coName;
|
||||
private String form;
|
||||
private String formSpec;
|
||||
private String packSpec;
|
||||
private String authCode;
|
||||
private String name;
|
||||
private String nameCode;
|
||||
private String packRatio;
|
||||
private String packLevel;
|
||||
private Integer bhxjsl;
|
||||
private Integer bhzxxsbzsl;
|
||||
private Integer zxxsbzbhsydysl;
|
||||
private String bhxjcpbm;
|
||||
private String bzcj;
|
||||
private String thirdProductNo;
|
||||
private String addType;
|
||||
private String deviceRecordKey;
|
||||
private int isUseDy;
|
||||
private String thirdProductName;
|
||||
|
||||
private String qxlb;
|
||||
private String tyshxydm;
|
||||
private String cpmctymc;
|
||||
private String ybbm;
|
||||
private String cphhhbh;
|
||||
private String ggxh;
|
||||
private String spmc;
|
||||
private String ylqxzcrbarmc;
|
||||
|
||||
ProductInfoEntity productInfoEntity;
|
||||
List<ProductInfoEntity> packages;
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,14 +1,18 @@
|
||||
package com.glxp.sale.admin.service.info;
|
||||
package com.glxp.sale.admin.service.auth;
|
||||
|
||||
import com.glxp.sale.admin.entity.info.DeviceKeyEntity;
|
||||
import com.glxp.sale.admin.req.info.DeleteRequest;
|
||||
import com.glxp.sale.admin.req.info.FilterDeviceKeyRequest;
|
||||
import com.glxp.sale.admin.req.inout.DeleteRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DeviceKeyService {
|
||||
List<DeviceKeyEntity> findDeviceKey(FilterDeviceKeyRequest filterDeviceKeyRequest);
|
||||
|
||||
DeviceKeyEntity findDeviceByImei(FilterDeviceKeyRequest filterDeviceKeyRequest);
|
||||
|
||||
DeviceKeyEntity findDeviceByImei(String imei);
|
||||
|
||||
void insertDeviceKey(DeviceKeyEntity deviceKeyEntity);
|
||||
|
||||
void updateDeviceKeyByImei(DeviceKeyEntity deviceKeyEntity);
|
@ -0,0 +1,28 @@
|
||||
package com.glxp.sale.admin.service.basic;
|
||||
|
||||
|
||||
import com.glxp.sale.admin.entity.basic.UdiCompanyEntity;
|
||||
import com.glxp.sale.admin.entity.udid.Contactlist;
|
||||
import com.glxp.sale.admin.req.basic.UdiCompanyRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UdiCompanyService {
|
||||
|
||||
List<UdiCompanyEntity> selectAllTyshxyh();
|
||||
|
||||
List<Contactlist> selectContactBykey(String deviceRecordKey);
|
||||
|
||||
List<UdiCompanyEntity> filterUdiCompany(UdiCompanyRequest udiCompanyRequest);
|
||||
|
||||
boolean insertUdiCompany(UdiCompanyEntity udiCompanyEntity);
|
||||
|
||||
boolean insertUdiCompanys(List<UdiCompanyEntity> udiCompanyEntities);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteAll(List<String> ids);
|
||||
|
||||
boolean updateUdiCompany(UdiCompanyEntity udiCompanyEntity);
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.glxp.sale.admin.service.basic.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.sale.admin.dao.basic.UdiCompanyDao;
|
||||
import com.glxp.sale.admin.entity.basic.UdiCompanyEntity;
|
||||
import com.glxp.sale.admin.entity.udid.Contactlist;
|
||||
import com.glxp.sale.admin.req.basic.UdiCompanyRequest;
|
||||
import com.glxp.sale.admin.service.basic.UdiCompanyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class UdiCompanyServiceImpl implements UdiCompanyService {
|
||||
|
||||
@Resource
|
||||
UdiCompanyDao udiCompanyDao;
|
||||
|
||||
@Override
|
||||
public List<UdiCompanyEntity> selectAllTyshxyh() {
|
||||
return udiCompanyDao.selectAllTyshxyh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Contactlist> selectContactBykey(String deviceRecordKey) {
|
||||
return udiCompanyDao.selectContactBykey(deviceRecordKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UdiCompanyEntity> filterUdiCompany(UdiCompanyRequest udiCompanyRequest) {
|
||||
if (udiCompanyRequest.getPage() != null && udiCompanyRequest.getLimit() != null) {
|
||||
int offset = (udiCompanyRequest.getPage() - 1) * udiCompanyRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, udiCompanyRequest.getLimit());
|
||||
}
|
||||
return udiCompanyDao.filterUdiCompany(udiCompanyRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertUdiCompany(UdiCompanyEntity udiCompanyEntity) {
|
||||
return udiCompanyDao.insertUdiCompany(udiCompanyEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertUdiCompanys(List<UdiCompanyEntity> udiCompanyEntities) {
|
||||
return udiCompanyDao.insertUdiCompanys(udiCompanyEntities);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return udiCompanyDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteAll(List<String> ids) {
|
||||
return udiCompanyDao.deleteAll(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateUdiCompany(UdiCompanyEntity udiCompanyEntity) {
|
||||
return udiCompanyDao.updateUdiCompany(udiCompanyEntity);
|
||||
}
|
||||
}
|
@ -1,41 +1,49 @@
|
||||
package com.glxp.sale.admin.service.receipt;
|
||||
|
||||
import com.glxp.sale.admin.entity.inout.ErpDetailCodeEntity;
|
||||
import com.glxp.sale.admin.entity.inout.OrderDetailEntity;
|
||||
|
||||
import com.glxp.sale.admin.entity.receipt.ProductInfoEntity;
|
||||
import com.glxp.sale.admin.req.receipt.ProductInfoFilterRequest;
|
||||
import com.glxp.sale.admin.res.inout.ProductInfoResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ProductInfoService {
|
||||
|
||||
List<ProductInfoEntity> filterList(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<ProductInfoResponse> filterDrugList(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
//赋码用
|
||||
//获取产品名称通用名称
|
||||
List<ProductInfoEntity> filterCpmctymc(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<ProductInfoResponse> filterDrugListByUuid(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
List<ProductInfoEntity> filterProductInfo(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<ProductInfoResponse> filterUdiList(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
List<ProductInfoEntity> filterUdiByTyshxydm(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
boolean insertProductInfo(ProductInfoEntity productInfoEntity);
|
||||
List<ProductInfoEntity> filterUdiByCreditNo(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
boolean updateProductInfo(ProductInfoEntity productInfoEntity);
|
||||
boolean updateUseDy(ProductInfoEntity productInfoEntity);
|
||||
boolean deleteById(String id);
|
||||
List<ProductInfoEntity> filterUdiByNewest(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
boolean deleteAll(List<String> ids);
|
||||
List<ProductInfoEntity> findAllByUuid(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<ProductInfoEntity> filterUdi(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
ProductInfoEntity selectById(String id);
|
||||
List<ProductInfoEntity> selectByUuid(String uuid);
|
||||
|
||||
List<OrderDetailEntity> findByCodes(List<String> codes);
|
||||
List<ProductInfoEntity> syncDlUdi(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
List<String> findNameCodeByGid(String goodsId);
|
||||
List<ProductInfoEntity> findAll(ProductInfoFilterRequest productInfoFilterRequest);
|
||||
|
||||
boolean isExit(String nameCode);
|
||||
List<ProductInfoEntity> selectByUpdateTime(String startDate, String endDate);//按更新时间查询
|
||||
|
||||
boolean insertProductInfo(ProductInfoEntity productInfoEntity);
|
||||
|
||||
ErpDetailCodeEntity getDetailCode(String code);
|
||||
boolean insertProductInfos(List<ProductInfoEntity> productInfoEntities);
|
||||
|
||||
boolean updateProductByUuid(ProductInfoEntity productInfoEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteAll(List<String> ids);
|
||||
|
||||
boolean updateProductInfo(ProductInfoEntity productInfoEntity);
|
||||
|
||||
ErpDetailCodeEntity getDetailCodeNoBh(String code);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
package com.glxp.sale.admin.service.thrsys;
|
||||
|
||||
import com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity;
|
||||
import com.glxp.sale.admin.entity.thrsys.ThrProductsEntity;
|
||||
import com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ThrProductsAddService {
|
||||
|
||||
List<ThrProductsAddEntity> filterThrProductsRequest(FilterThrProductsRequest filterThrProductsRequest);
|
||||
|
||||
List<ThrProductsAddEntity> selectThrProducts(FilterThrProductsRequest filterThrProductsRequest);
|
||||
|
||||
ThrProductsAddEntity selectById(String id);
|
||||
|
||||
boolean insertThrProducts(ThrProductsAddEntity thrProductsEntity);
|
||||
|
||||
boolean insertThrProductss(List<ThrProductsAddEntity> thrProductsEntities);
|
||||
|
||||
boolean updateThrProducts(ThrProductsAddEntity thrProductsEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteAll();
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.glxp.sale.admin.service.thrsys.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.sale.admin.dao.thrsys.ThrProductsAddDao;
|
||||
import com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity;
|
||||
import com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest;
|
||||
import com.glxp.sale.admin.service.thrsys.ThrProductsAddService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ThrProductsAddServiceImpl implements ThrProductsAddService {
|
||||
|
||||
@Resource
|
||||
ThrProductsAddDao thrProductsAddDao;
|
||||
|
||||
|
||||
@Override
|
||||
public List<ThrProductsAddEntity> filterThrProductsRequest(FilterThrProductsRequest filterThrProductsRequest) {
|
||||
if (filterThrProductsRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterThrProductsRequest.getPage() != null) {
|
||||
int offset = (filterThrProductsRequest.getPage() - 1) * filterThrProductsRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterThrProductsRequest.getLimit());
|
||||
}
|
||||
List<ThrProductsAddEntity> data = thrProductsAddDao.filterThrProductsRequest(filterThrProductsRequest);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ThrProductsAddEntity> selectThrProducts(FilterThrProductsRequest filterThrProductsRequest) {
|
||||
if (filterThrProductsRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterThrProductsRequest.getPage() != null) {
|
||||
int offset = (filterThrProductsRequest.getPage() - 1) * filterThrProductsRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterThrProductsRequest.getLimit());
|
||||
}
|
||||
List<ThrProductsAddEntity> data = thrProductsAddDao.selectThrProducts(filterThrProductsRequest);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThrProductsAddEntity selectById(String id) {
|
||||
return thrProductsAddDao.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertThrProducts(ThrProductsAddEntity thrProductsEntity) {
|
||||
return thrProductsAddDao.insertThrProducts(thrProductsEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertThrProductss(List<ThrProductsAddEntity> thrProductsEntities) {
|
||||
return thrProductsAddDao.insertThrProductss(thrProductsEntities);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateThrProducts(ThrProductsAddEntity thrProductsEntity) {
|
||||
return thrProductsAddDao.updateThrProducts(thrProductsEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return thrProductsAddDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteAll() {
|
||||
return thrProductsAddDao.deleteAll();
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.glxp.sale.admin.thread;
|
||||
|
||||
import com.glxp.sale.admin.dao.basic.ProductInfoDao;
|
||||
import com.glxp.sale.admin.entity.basic.UdiCompanyEntity;
|
||||
import com.glxp.sale.admin.service.basic.UdiCompanyService;
|
||||
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 AsyncCompanyDlHelper {
|
||||
@Resource
|
||||
UdiCompanyService udiCompanyService;
|
||||
@Resource
|
||||
ProductInfoDao productInfoDao;
|
||||
|
||||
@Value("${UDI_SERVER_URL}")
|
||||
private String udiUrl;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AsyncCompanyDlHelper.class);
|
||||
|
||||
|
||||
@Async
|
||||
public void asyncDiByTime(String updateTime) {
|
||||
AsyncDiDlHelper asyncDiDlHelper = new AsyncDiDlHelper();
|
||||
int page = 1;
|
||||
int limit = 300;
|
||||
while (true) {
|
||||
logger.info("更新时间:" + updateTime + "----" + page + "----" + limit);
|
||||
List<UdiCompanyEntity> udiCompanyEntities = asyncDiDlHelper.dlCompanyByTime(udiUrl, page, limit, updateTime);
|
||||
if (udiCompanyEntities != null && udiCompanyEntities.size() > 0) {
|
||||
udiCompanyService.insertUdiCompanys(udiCompanyEntities);
|
||||
if (udiCompanyEntities.size() < limit) {
|
||||
break;
|
||||
} else {
|
||||
page++;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
logger.info("更新时间:" + updateTime + "----" + "下载结束");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.glxp.sale.admin.thread;
|
||||
|
||||
import com.glxp.sale.admin.dao.info.ScheduledDao;
|
||||
import com.glxp.sale.admin.entity.info.ScheduledEntity;
|
||||
import com.glxp.sale.admin.req.udid.ScheduledRequest;
|
||||
import com.glxp.sale.admin.util.DateUtil;
|
||||
import com.glxp.sale.admin.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 AsyncCompanyDlTask implements SchedulingConfigurer {
|
||||
|
||||
final Logger logger = LoggerFactory.getLogger(AsyncDiDlTask.class);
|
||||
@Resource
|
||||
AsyncCompanyDlHelper udiCompanyTask;
|
||||
@Resource
|
||||
RedisUtil redisUtil;
|
||||
|
||||
@Resource
|
||||
private ScheduledDao scheduledDao;
|
||||
|
||||
@Override
|
||||
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
|
||||
scheduledTaskRegistrar.addTriggerTask(() -> process(),
|
||||
triggerContext -> {
|
||||
ScheduledRequest scheduledRequest = new ScheduledRequest();
|
||||
scheduledRequest.setCronName("syncCompany");
|
||||
ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest);
|
||||
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 lastUpDiTime = (String) redisUtil.get("lastUpCompanyTime");
|
||||
if (lastUpDiTime == null) {
|
||||
lastUpDiTime = DateUtil.getLastDayFormat(-10);
|
||||
}
|
||||
udiCompanyTask.asyncDiByTime(lastUpDiTime);
|
||||
redisUtil.set("lastUpCompanyTime", DateUtil.formatDate(new Date()));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.glxp.sale.admin.thread;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.glxp.sale.admin.entity.basic.UdiCompanyEntity;
|
||||
import com.glxp.sale.admin.entity.receipt.ProductInfoEntity;
|
||||
import com.glxp.sale.admin.util.HttpClient;
|
||||
import com.glxp.sale.common.res.BaseResponse;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AsyncDiDlHelper {
|
||||
|
||||
public List<ProductInfoEntity> dlByTime(String udiUrl, int page, int limit, String updateTime) {
|
||||
Map<String, Object> paramMap = new HashMap<>(16);
|
||||
paramMap.put("page", page);
|
||||
paramMap.put("limit", limit);
|
||||
paramMap.put("updateTime", updateTime);
|
||||
String response = HttpClient.mipsGet(udiUrl + "/udidl/udiwms/syncUdi", paramMap);
|
||||
try {
|
||||
BaseResponse<List<ProductInfoEntity>> udiDlDeviceResponse = (BaseResponse<List<ProductInfoEntity>>) JSONObject.parseObject(response, BaseResponse.class);
|
||||
List<ProductInfoEntity> udiInfoEntities = udiDlDeviceResponse.getData();
|
||||
return udiInfoEntities;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<UdiCompanyEntity> dlCompanyByTime(String udiUrl, int page, int limit, String updateTime) {
|
||||
Map<String, Object> paramMap = new HashMap<>(16);
|
||||
paramMap.put("page", page);
|
||||
paramMap.put("limit", limit);
|
||||
paramMap.put("updateTime", updateTime);
|
||||
String response = HttpClient.mipsGet(udiUrl + "/udidl/udiwms/syncCompany", paramMap);
|
||||
try {
|
||||
BaseResponse<List<UdiCompanyEntity>> baseResponse = (BaseResponse<List<UdiCompanyEntity>>) JSONObject.parseObject(response, BaseResponse.class);
|
||||
List<UdiCompanyEntity> udiCompanyEntities = baseResponse.getData();
|
||||
return udiCompanyEntities;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.glxp.sale.admin.thread;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.glxp.sale.admin.entity.basic.UdiInfoImportLogEntity;
|
||||
import com.glxp.sale.admin.entity.receipt.ProductInfoEntity;
|
||||
import com.glxp.sale.admin.entity.thrsys.ThrImportLogEntity;
|
||||
import com.glxp.sale.admin.service.basic.UdiInfoImportLogService;
|
||||
import com.glxp.sale.admin.service.receipt.ProductInfoService;
|
||||
import com.glxp.sale.admin.service.thrsys.ThrImportLogService;
|
||||
import com.glxp.sale.admin.util.CustomUtil;
|
||||
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
|
||||
ThrImportLogService udiInfoImportLogService;
|
||||
private static final Logger logger = LoggerFactory.getLogger(AsyncDiDlService.class);
|
||||
|
||||
@Async
|
||||
public void asyncDiByTime(String updateTime) {
|
||||
AsyncDiDlHelper asyncDiDlHelper = new AsyncDiDlHelper();
|
||||
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 + "----" + "下载结束");
|
||||
}
|
||||
|
||||
@Async
|
||||
public void importJsonData(String genKey, String laststr) {
|
||||
ThrImportLogEntity udiInfoImportLogEntity = udiInfoImportLogService.selectByGenKey(genKey);
|
||||
udiInfoImportLogEntity.setStatus(1);
|
||||
udiInfoImportLogEntity.setFromType("2");
|
||||
udiInfoImportLogService.updateImportLog(udiInfoImportLogEntity);
|
||||
List<ProductInfoEntity> productInfoEntities = JSONArray.parseArray(laststr, ProductInfoEntity.class);
|
||||
List<List<ProductInfoEntity>> splitList = CustomUtil.splitList(productInfoEntities, 500);
|
||||
for (List<ProductInfoEntity> data : splitList) {
|
||||
productInfoService.insertProductInfos(data);
|
||||
}
|
||||
udiInfoImportLogEntity.setStatus(3);//处理成功
|
||||
udiInfoImportLogService.updateImportLog(udiInfoImportLogEntity);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.glxp.sale.admin.thread;
|
||||
|
||||
import com.glxp.sale.admin.dao.info.ScheduledDao;
|
||||
import com.glxp.sale.admin.entity.info.ScheduledEntity;
|
||||
import com.glxp.sale.admin.req.udid.ScheduledRequest;
|
||||
import com.glxp.sale.admin.util.DateUtil;
|
||||
import com.glxp.sale.admin.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);
|
||||
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()));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,510 @@
|
||||
<?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.sale.admin.dao.basic.ProductInfoDao">
|
||||
|
||||
<select id="filterProductInfo" parameterType="com.glxp.sale.admin.req.receipt.ProductInfoFilterRequest"
|
||||
resultType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
SELECT * FROM productinfo
|
||||
<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="deviceRecordKey != '' and deviceRecordKey != null">
|
||||
AND deviceRecordKey = #{deviceRecordKey}
|
||||
</if>
|
||||
<if test="ggxh != '' and ggxh != null">
|
||||
AND ggxh LIKE concat(#{ggxh},'%')
|
||||
</if>
|
||||
<if test="tyshxydm != '' and tyshxydm != null">
|
||||
AND tyshxydm = #{tyshxydm}
|
||||
</if>
|
||||
<if test="updateTime!=null and updateTime!=''">
|
||||
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
||||
</if>
|
||||
|
||||
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="filterCpmctymc" parameterType="com.glxp.sale.admin.req.receipt.ProductInfoFilterRequest"
|
||||
resultType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
select * from productinfo
|
||||
<where>
|
||||
<if test="tyshxydm != '' and tyshxydm != null">
|
||||
AND tyshxydm = #{tyshxydm}
|
||||
</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="updateTime!=null and updateTime!=''">
|
||||
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY cpmctymc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="filterUdiByTyshxydm" parameterType="com.glxp.sale.admin.req.receipt.ProductInfoFilterRequest"
|
||||
resultType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
SELECT * FROM productinfo
|
||||
<where>
|
||||
diType = 1
|
||||
<if test="tyshxydm != '' and tyshxydm != null">
|
||||
AND tyshxydm = #{tyshxydm}
|
||||
</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="updateTime!=null and updateTime!=''">
|
||||
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY nameCode
|
||||
</select>
|
||||
|
||||
<select id="selectAllByUuid" parameterType="java.util.List"
|
||||
resultType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
select * from productinfo where
|
||||
uuid in (
|
||||
<foreach collection="ids" item="item" index="index"
|
||||
separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByUuid" parameterType="Map"
|
||||
resultType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
select *
|
||||
from productinfo
|
||||
where uuid = #{uuid}
|
||||
</select>
|
||||
<!-- CHAR_LENGTH(nameCode) <![CDATA[ >= ]]> 14-->
|
||||
<select id="filterUdiByCreditNo" parameterType="com.glxp.sale.admin.req.receipt.ProductInfoFilterRequest"
|
||||
resultType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
|
||||
select p.* from productinfo p INNER JOIN
|
||||
(select deviceRecordKey ,max(versionNumber) versionNumber from productinfo
|
||||
|
||||
<where>
|
||||
|
||||
<if test="tyshxydm != '' and tyshxydm != null">
|
||||
AND tyshxydm = #{tyshxydm}
|
||||
</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>
|
||||
</where>
|
||||
GROUP BY deviceRecordKey)
|
||||
a on p.deviceRecordKey = a.deviceRecordKey and p.versionNumber = a.versionNumber
|
||||
<where>
|
||||
<if test="diType != '' and diType != null">
|
||||
AND diType = #{diType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="filterUdiByNewest" parameterType="com.glxp.sale.admin.req.receipt.ProductInfoFilterRequest"
|
||||
resultType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
|
||||
SELECT * FROM productinfo
|
||||
<where>
|
||||
<if test="tyshxydm != '' and tyshxydm != null">
|
||||
AND tyshxydm = #{tyshxydm}
|
||||
</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="isNewest != null">
|
||||
AND isNewest = #{isNewest}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="filterUuidByCreditNo" parameterType="com.glxp.sale.admin.req.receipt.ProductInfoFilterRequest"
|
||||
resultType="java.lang.String">
|
||||
|
||||
select p.uuid from productinfo p INNER JOIN
|
||||
(select deviceRecordKey ,max(versionNumber) versionNumber from productinfo
|
||||
|
||||
<where>
|
||||
<if test="tyshxydm != '' and tyshxydm != null">
|
||||
AND tyshxydm = #{tyshxydm}
|
||||
</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>
|
||||
</where>
|
||||
GROUP BY deviceRecordKey)
|
||||
a on p.deviceRecordKey = a.deviceRecordKey and p.versionNumber = a.versionNumber
|
||||
group by uuid
|
||||
</select>
|
||||
<select id="filterUdi" parameterType="com.glxp.sale.admin.req.receipt.ProductInfoFilterRequest"
|
||||
resultType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
|
||||
select * from productinfo
|
||||
<where>
|
||||
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
|
||||
AND ylqxzcrbarmc= #{ylqxzcrbarmc}
|
||||
</if>
|
||||
|
||||
<if test="ylqxzcrbarmc == '' and cpmctymc != '' and cpmctymc != null">
|
||||
AND cpmctymc LIKE concat(#{cpmctymc},'%')
|
||||
</if>
|
||||
|
||||
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null and 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="ggxh != '' and ggxh != null">
|
||||
AND ggxh LIKE concat('%',#{ggxh},'%')
|
||||
</if>
|
||||
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
|
||||
AND zczbhhzbapzbh LIKE concat('%',#{zczbhhzbapzbh},'%')
|
||||
</if>
|
||||
|
||||
<if test="deviceRecordKey != '' and deviceRecordKey != null">
|
||||
AND deviceRecordKey = #{deviceRecordKey}
|
||||
</if>
|
||||
<if test="updateTime!=null and updateTime!=''">
|
||||
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
||||
</if>
|
||||
<if test="isNewest != null and isNewest!=''">
|
||||
AND isNewest = #{isNewest}
|
||||
</if>
|
||||
<if test="diType != '' and diType != null">
|
||||
AND diType = #{diType}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
|
||||
</select>
|
||||
<select id="selectByUpdateTime"
|
||||
resultType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
select *
|
||||
from productinfo
|
||||
where
|
||||
<![CDATA[ DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S') ]]>
|
||||
and
|
||||
<![CDATA[ DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S')
|
||||
]]>
|
||||
</select>
|
||||
<!--<select id="filterUdi" parameterType="com.glxp.sync.admin.req.ProductInfoFilterRequest"-->
|
||||
<!--resultType="com.glxp.sync.admin.entity.udi.ProductInfoEntity">-->
|
||||
<!---- GROUP BY deviceRecordKey-->
|
||||
<!--select p.* from productinfo p INNER JOIN-->
|
||||
<!--(select deviceRecordKey ,max(versionNumber) versionNumber from productinfo-->
|
||||
<!--<where>-->
|
||||
|
||||
<!--<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">-->
|
||||
<!--AND ylqxzcrbarmc= #{ylqxzcrbarmc}-->
|
||||
<!--</if>-->
|
||||
|
||||
<!--<if test="ylqxzcrbarmc == '' and ylqxzcrbarmc == null and cpmctymc != '' and cpmctymc != null">-->
|
||||
<!--AND cpmctymc LIKE concat(#{cpmctymc},'%')-->
|
||||
<!--</if>-->
|
||||
|
||||
<!--<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null and 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="ggxh != '' and ggxh != null">-->
|
||||
<!--AND ggxh LIKE concat('%',#{ggxh},'%')-->
|
||||
<!--</if>-->
|
||||
<!--<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">-->
|
||||
<!--AND zczbhhzbapzbh LIKE concat('%',#{zczbhhzbapzbh},'%')-->
|
||||
<!--</if>-->
|
||||
|
||||
<!--<if test="deviceRecordKey != '' and deviceRecordKey != null">-->
|
||||
<!--AND deviceRecordKey = #{deviceRecordKey}-->
|
||||
<!--</if>-->
|
||||
<!--<if test="updateTime!=null and updateTime!=''">-->
|
||||
<!--<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>-->
|
||||
<!--</if>-->
|
||||
<!--</where>-->
|
||||
<!--GROUP BY deviceRecordKey)-->
|
||||
<!--a on p.deviceRecordKey = a.deviceRecordKey and p.versionNumber = a.versionNumber-->
|
||||
|
||||
<!--</select>-->
|
||||
|
||||
<select id="syncDlUdi" parameterType="com.glxp.sale.admin.req.receipt.ProductInfoFilterRequest"
|
||||
resultType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
|
||||
SELECT * FROM productinfo
|
||||
<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="ggxh != '' and ggxh != null">
|
||||
AND ggxh LIKE concat('%',#{ggxh},'%')
|
||||
</if>
|
||||
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
|
||||
AND zczbhhzbapzbh = #{zczbhhzbapzbh}
|
||||
</if>
|
||||
<if test="deviceRecordKey != '' and deviceRecordKey != null">
|
||||
AND deviceRecordKey = #{deviceRecordKey}
|
||||
</if>
|
||||
<if test="updateTime!=null and updateTime!=''">
|
||||
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
||||
</if>
|
||||
</where>
|
||||
limit #{page},#{limit}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertProductInfo" keyProperty="id"
|
||||
parameterType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
REPLACE
|
||||
INTO productinfo
|
||||
(
|
||||
id,nameCode,packRatio,packLevel,bhxjsl,
|
||||
bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,thirdProductNo,addType,deviceRecordKey,isUseDy,thirdProductName,
|
||||
cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber
|
||||
,diType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,
|
||||
ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime
|
||||
)
|
||||
values
|
||||
(
|
||||
#{id},
|
||||
#{nameCode},
|
||||
#{packRatio},
|
||||
#{packLevel},
|
||||
#{bhxjsl},
|
||||
#{bhzxxsbzsl},
|
||||
#{zxxsbzbhsydysl},
|
||||
#{bhxjcpbm},
|
||||
#{bzcj},
|
||||
#{thirdProductNo},
|
||||
#{addType},
|
||||
#{deviceRecordKey},
|
||||
#{isUseDy},
|
||||
#{thirdProductName},
|
||||
#{cpmctymc},
|
||||
#{cplb},
|
||||
#{flbm},
|
||||
#{ggxh},
|
||||
#{qxlb},
|
||||
#{tyshxydm},
|
||||
#{ylqxzcrbarmc},
|
||||
#{zczbhhzbapzbh},
|
||||
#{ylqxzcrbarywmc},
|
||||
#{uuid},
|
||||
#{sjcpbm},
|
||||
#{versionNumber},
|
||||
#{diType},
|
||||
#{scbssfbhph},
|
||||
#{scbssfbhxlh},
|
||||
#{scbssfbhscrq},
|
||||
#{scbssfbhsxrq},
|
||||
#{ybbm},
|
||||
#{spmc},
|
||||
#{cphhhbh},
|
||||
#{cpms},
|
||||
#{cpbsbmtxmc},
|
||||
#{isNewest},
|
||||
#{updateTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="insertProductInfos" keyProperty="id"
|
||||
parameterType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
REPLACE INTO productinfo
|
||||
(
|
||||
id,nameCode,packRatio,packLevel,bhxjsl,
|
||||
bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,thirdProductNo,addType,deviceRecordKey,isUseDy,thirdProductName,
|
||||
cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber
|
||||
,diType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,
|
||||
ybbm,spmc,cphhhbh,cpms,cpbsbmtxmc,isNewest,updateTime
|
||||
) values
|
||||
|
||||
<foreach collection="datas" item="item" index="index"
|
||||
separator=",">
|
||||
|
||||
|
||||
(
|
||||
#{item.id},
|
||||
#{item.nameCode},
|
||||
#{item.packRatio},
|
||||
#{item.packLevel},
|
||||
#{item.bhxjsl},
|
||||
#{item.bhzxxsbzsl},
|
||||
#{item.zxxsbzbhsydysl},
|
||||
#{item.bhxjcpbm},
|
||||
#{item.bzcj},
|
||||
#{item.thirdProductNo},
|
||||
#{item.addType},
|
||||
#{item.deviceRecordKey},
|
||||
#{item.isUseDy},
|
||||
#{item.thirdProductName},
|
||||
#{item.cpmctymc},
|
||||
#{item.cplb},
|
||||
#{item.flbm},
|
||||
#{item.ggxh},
|
||||
#{item.qxlb},
|
||||
#{item.tyshxydm},
|
||||
#{item.ylqxzcrbarmc},
|
||||
#{item.zczbhhzbapzbh},
|
||||
#{item.ylqxzcrbarywmc},
|
||||
#{item.uuid},
|
||||
#{item.sjcpbm},
|
||||
#{item.versionNumber},
|
||||
#{item.diType},
|
||||
#{item.scbssfbhph},
|
||||
#{item.scbssfbhxlh},
|
||||
#{item.scbssfbhscrq},
|
||||
#{item.scbssfbhsxrq},
|
||||
#{item.ybbm},
|
||||
#{item.spmc},
|
||||
#{item.cphhhbh},
|
||||
#{item.cpms},
|
||||
#{item.cpbsbmtxmc},
|
||||
#{item.isNewest},
|
||||
#{item.updateTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM productinfo
|
||||
WHERE thirdProductNo = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAll" parameterType="java.util.List">
|
||||
DELETE FROM productinfo WHERE thirdProductNo in
|
||||
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateProductInfo" parameterType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
UPDATE productinfo
|
||||
<set>
|
||||
<if test="nameCode != null">nameCode=#{nameCode},</if>
|
||||
<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="thirdProductNo != null">thirdProductNo=#{thirdProductNo},</if>
|
||||
<if test="addType != null">addType=#{addType},</if>
|
||||
<if test="deviceRecordKey != null">deviceRecordKey=#{deviceRecordKey},</if>
|
||||
<if test="isUseDy != null">isUseDy=#{isUseDy},</if>
|
||||
<if test="thirdProductName != null">thirdProductName=#{thirdProductName},</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="diType != null">diType=#{diType},</if>
|
||||
<if test="isNewest != null">isNewest=#{isNewest},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateProductByUuid" parameterType="com.glxp.sale.admin.entity.receipt.ProductInfoEntity">
|
||||
UPDATE productinfo
|
||||
<set>
|
||||
<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="ybbm != null">ybbm=#{ybbm},</if>
|
||||
<if test="spmc != null">spmc=#{spmc},</if>
|
||||
<if test="cphhhbh != null">cphhhbh=#{cphhhbh},</if>
|
||||
<if test="cpms != null">cpms=#{cpms},</if>
|
||||
<if test="cpbsbmtxmc != null">cpbsbmtxmc=#{cpbsbmtxmc},</if>
|
||||
<if test="isNewest != null">isNewest=#{isNewest},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
</set>
|
||||
WHERE uuid = #{uuid}
|
||||
</update>
|
||||
|
||||
|
||||
<!--测试专用-->
|
||||
<select id="findAllUuids" parameterType="com.glxp.sale.admin.req.ListPageRequest" resultType="java.lang.String">
|
||||
SELECT uuid
|
||||
from device
|
||||
group by uuid limit #{page}, #{limit}
|
||||
</select>
|
||||
<select id="findAllTyshxyh" resultType="java.lang.String">
|
||||
SELECT tyshxydm
|
||||
from productinfo
|
||||
group by tyshxydm
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,109 @@
|
||||
<?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.sale.admin.dao.basic.UdiCompanyDao">
|
||||
|
||||
<select id="selectAllTyshxyh"
|
||||
resultType="com.glxp.sale.admin.entity.basic.UdiCompanyEntity">
|
||||
SELECT deviceRecordKey, tyshxydm, ylqxzcrbarmc, ylqxzcrbarywmc
|
||||
FROM device
|
||||
GROUP BY tyshxydm
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectContactBykey" parameterType="Map"
|
||||
resultType="com.glxp.sale.admin.entity.udid.Contactlist">
|
||||
SELECT qylxrdh, qylxryx, qylxrcz
|
||||
from contactlist
|
||||
WHERE deviceRecordKey = #{deviceRecordKey}
|
||||
</select>
|
||||
|
||||
<select id="filterUdiCompany"
|
||||
parameterType="com.glxp.sale.admin.req.basic.UdiCompanyRequest"
|
||||
resultType="com.glxp.sale.admin.entity.basic.UdiCompanyEntity">
|
||||
SELECT * FROM udicompany
|
||||
<where>
|
||||
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
|
||||
AND ylqxzcrbarmc LIKE concat('%',#{ylqxzcrbarmc},'%')
|
||||
</if>
|
||||
<if test="tyshxydm != '' and tyshxydm != null">
|
||||
AND tyshxydm =#{tyshxydm}
|
||||
</if>
|
||||
<if test="provinceCode != '' and provinceCode != null">
|
||||
AND SUBSTRING(tyshxydm,3,2) = #{provinceCode}
|
||||
</if>
|
||||
<if test="cityCode != '' and cityCode != null">
|
||||
AND SUBSTRING(tyshxydm,3,4) = #{cityCode}
|
||||
</if>
|
||||
<if test="areaCode != '' and areaCode != null">
|
||||
AND SUBSTRING(tyshxydm,3,6) = #{areaCode}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertUdiCompany" keyProperty="id" parameterType="com.glxp.sale.admin.entity.basic.UdiCompanyEntity">
|
||||
REPLACE
|
||||
INTO udicompany
|
||||
(
|
||||
id,tyshxydm,ylqxzcrbarmc,ylqxzcrbarywmc,qylxrdh,
|
||||
qylxrcz,qylxryx
|
||||
)
|
||||
values
|
||||
(
|
||||
#{id},
|
||||
#{tyshxydm},
|
||||
#{ylqxzcrbarmc},
|
||||
#{ylqxzcrbarywmc},
|
||||
#{qylxrdh},
|
||||
#{qylxrcz},
|
||||
#{qylxryx}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertUdiCompanys" keyProperty="id" parameterType="com.glxp.sale.admin.entity.basic.UdiCompanyEntity">
|
||||
replace INTO udicompany(id,
|
||||
tyshxydm,ylqxzcrbarmc,ylqxzcrbarywmc,qylxrdh,
|
||||
qylxrcz,qylxryx)
|
||||
values
|
||||
<foreach collection="udiCompanyEntities" item="item" index="index"
|
||||
separator=",">
|
||||
|
||||
(
|
||||
#{item.id},
|
||||
#{item.tyshxydm},
|
||||
#{item.ylqxzcrbarmc},
|
||||
#{item.ylqxzcrbarywmc},
|
||||
#{item.qylxrdh},
|
||||
#{item.qylxrcz},
|
||||
#{item.qylxryx})
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM udicompany
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAll" parameterType="java.util.List">
|
||||
DELETE FROM udicompany WHERE id in
|
||||
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateUdiCompany" parameterType="com.glxp.sale.admin.entity.basic.UdiCompanyEntity">
|
||||
UPDATE udicompany
|
||||
<set>
|
||||
<if test="tyshxydm != null">tyshxydm=#{tyshxydm},</if>
|
||||
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
|
||||
<if test="ylqxzcrbarywmc != null">ylqxzcrbarywmc=#{ylqxzcrbarywmc},</if>
|
||||
<if test="qylxrdh != null">qylxrdh=#{qylxrdh},</if>
|
||||
<if test="qylxrcz != null">qylxrcz=#{qylxrcz},</if>
|
||||
<if test="qylxryx != null">qylxryx=#{qylxryx},</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,194 @@
|
||||
<?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.sale.admin.dao.thrsys.ThrProductsAddDao">
|
||||
|
||||
<select id="filterThrProductsRequest" parameterType="com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest"
|
||||
resultType="com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity">
|
||||
SELECT * FROM thr_products_add
|
||||
<where>
|
||||
<if test="name != '' and name != null">
|
||||
AND name LIKE concat('%',#{name},'%')
|
||||
</if>
|
||||
<if test="code != '' and code != null">
|
||||
AND code LIKE concat('%',#{code},'%')
|
||||
</if>
|
||||
<if test="registerNo != '' and registerNo != null">
|
||||
AND registerNo LIKE concat('%',#{registerNo},'%')
|
||||
</if>
|
||||
<if test="manufactory != '' and manufactory != null">
|
||||
AND manufactory LIKE concat('%',#{manufactory},'%')
|
||||
</if>
|
||||
<if test="spec != '' and spec != null">
|
||||
AND spec LIKE concat('%',#{spec},'%')
|
||||
</if>
|
||||
|
||||
<if test="supName != '' and supName != null">
|
||||
AND supName LIKE concat('%',#{supName},'%')
|
||||
</if>
|
||||
<if test="unionCode != '' and unionCode != null">
|
||||
or code LIKE concat('%',#{unionCode},'%') or sptm LIKE concat('%',#{unionCode},'%') or ybbm LIKE
|
||||
concat('%',#{unionCode},'%')
|
||||
</if>
|
||||
|
||||
<if test="thirdSysFk != '' and thirdSysFk != null">
|
||||
AND thirdSysFk = #{thirdSysFk}
|
||||
</if>
|
||||
<if test="checkStatus != '' and checkStatus != null">
|
||||
AND checkStatus = #{checkStatus}
|
||||
</if>
|
||||
<if test="customerId != '' and customerId != null">
|
||||
AND customerId = #{customerId}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY updateTime DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectThrProducts" parameterType="com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest"
|
||||
resultType="com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity">
|
||||
SELECT * FROM thr_products_add
|
||||
<where>
|
||||
<if test="name != '' and name != null">
|
||||
AND name =#{name}
|
||||
</if>
|
||||
<if test="code != '' and code != null">
|
||||
AND code =#{code}
|
||||
</if>
|
||||
<if test="registerNo != '' and registerNo != null">
|
||||
AND registerNo=#{registerNo}
|
||||
</if>
|
||||
<if test="manufactory != '' and manufactory != null">
|
||||
AND manufactory=#{manufactory}
|
||||
</if>
|
||||
<if test="thirdSysFk != '' and thirdSysFk != null">
|
||||
AND thirdSysFk = #{thirdSysFk}
|
||||
</if>
|
||||
<if test="checkStatus != '' and checkStatus != null">
|
||||
AND checkStatus = #{checkStatus}
|
||||
</if>
|
||||
<if test="customerId != '' and customerId != null">
|
||||
AND customerId = #{customerId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY updateTime DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="batchSelectByIds" resultType="com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity">
|
||||
select *
|
||||
from thr_products_add where code in
|
||||
<foreach collection="codes" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and thirdSysFk = #{thirdSysFk}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectById" parameterType="Map" resultType="com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity">
|
||||
select *
|
||||
FROM thr_products_add
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertThrProducts" keyProperty="id"
|
||||
parameterType="com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity">
|
||||
replace
|
||||
INTO thr_products_add
|
||||
(
|
||||
code,name,measname,spec,registerNo,manufactory,
|
||||
cplb,flbm,qxlb,ybbm,sptm,tyshxydm,zczbhhzbapzbh,ylqxzcrbarmc,ylqxzcrbarywmc,cpms,
|
||||
thirdSysFk,updateTime,supName,checkStatus,customerId
|
||||
)
|
||||
values
|
||||
(
|
||||
#{code},
|
||||
#{name},
|
||||
#{measname},
|
||||
#{spec},
|
||||
#{registerNo},
|
||||
#{manufactory},
|
||||
#{cplb},
|
||||
#{flbm},
|
||||
#{qxlb},
|
||||
#{ybbm},
|
||||
#{sptm},
|
||||
#{tyshxydm},
|
||||
#{zczbhhzbapzbh},
|
||||
#{ylqxzcrbarmc},
|
||||
#{ylqxzcrbarywmc},
|
||||
#{cpms},
|
||||
#{thirdSysFk},
|
||||
#{updateTime},
|
||||
#{supName},
|
||||
#{checkStatus},
|
||||
#{customerId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertThrProductss" keyProperty="id" parameterType="java.util.List">
|
||||
replace INTO thr_products_add
|
||||
(
|
||||
code,name,measname,spec,registerNo,manufactory,
|
||||
cplb,flbm,qxlb,ybbm,sptm,tyshxydm,zczbhhzbapzbh,ylqxzcrbarmc,ylqxzcrbarywmc,cpms,
|
||||
thirdSysFk,updateTime,supName,checkStatus,customerId
|
||||
)
|
||||
values
|
||||
|
||||
<foreach collection="thrProductsEntities" item="item" index="index"
|
||||
separator=",">
|
||||
(
|
||||
#{item.code},
|
||||
#{item.name},
|
||||
#{item.measname},
|
||||
#{item.spec},
|
||||
#{item.registerNo},
|
||||
#{item.manufactory},
|
||||
#{item.cplb}, #{item.flbm}, #{item.qxlb}, #{item.ybbm},#{item.sptm},
|
||||
#{item.tyshxydm}, #{item.zczbhhzbapzbh}, #{item.ylqxzcrbarmc}, #{item.ylqxzcrbarywmc},#{item.cpms},
|
||||
#{item.thirdSysFk},#{item.updateTime},#{item.supName}, #{tem.checkStatus}, #{tem.customerId}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM thr_products_add
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<update id="updateThrProducts" parameterType="com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity">
|
||||
UPDATE thr_products_add
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="code != null">code=#{code},</if>
|
||||
<if test="name != null">name=#{name},</if>
|
||||
<if test="measname != null">measname=#{measname},</if>
|
||||
<if test="spec != null">spec=#{spec},</if>
|
||||
<if test="registerNo != null">registerNo=#{registerNo},</if>
|
||||
<if test="cplb != null">cplb=#{cplb},</if>
|
||||
<if test="flbm != null">flbm=#{flbm},</if>
|
||||
<if test="qxlb != null">qxlb=#{qxlb},</if>
|
||||
<if test="ybbm != null">ybbm=#{ybbm},</if>
|
||||
<if test="sptm != null">sptm=#{sptm},</if>
|
||||
<if test="tyshxydm != null">tyshxydm=#{tyshxydm},</if>
|
||||
<if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if>
|
||||
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
|
||||
<if test="ylqxzcrbarywmc != null">ylqxzcrbarywmc=#{ylqxzcrbarywmc},</if>
|
||||
<if test="manufactory != null">manufactory=#{manufactory},</if>
|
||||
<if test="cpms != null">cpms=#{cpms},</if>
|
||||
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="supName != null">supName=#{supName},</if>
|
||||
<if test="checkStatus != null">checkStatus=#{checkStatus},</if>
|
||||
<if test="customerId != null">customerId=#{customerId},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAll">
|
||||
DELETE
|
||||
FROM thr_products_add
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue