customerId从Long型改为String型,首营管理代码新增
parent
10c4fd2839
commit
5214b9a136
@ -0,0 +1,120 @@
|
||||
package com.glxp.sale.admin.controller.purechase;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.sale.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.sale.admin.entity.auth.AuthAdmin;
|
||||
import com.glxp.sale.admin.entity.purchase.SupCertEntity;
|
||||
import com.glxp.sale.admin.exception.JsonException;
|
||||
import com.glxp.sale.admin.req.info.DeleteCompanyFileRequest;
|
||||
import com.glxp.sale.admin.req.purchase.FilterSupCertRequest;
|
||||
import com.glxp.sale.admin.res.PageSimpleResponse;
|
||||
import com.glxp.sale.admin.service.auth.AuthAdminService;
|
||||
import com.glxp.sale.admin.service.purchase.SupCertService;
|
||||
import com.glxp.sale.common.enums.ResultEnum;
|
||||
import com.glxp.sale.common.res.BaseResponse;
|
||||
import com.glxp.sale.common.util.ResultVOUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
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 org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class SupCertController {
|
||||
@Resource
|
||||
private AuthAdminService authAdminService;
|
||||
@Resource
|
||||
private SupCertService supCertService;
|
||||
|
||||
@Value("${file_path}")
|
||||
private String filePath;
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/sup/company/cert/filter")
|
||||
public BaseResponse filterCompanyCert(FilterSupCertRequest filterSupCertRequest,
|
||||
BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<SupCertEntity> supCertEntityList
|
||||
= supCertService.filterCompanyCert(filterSupCertRequest);
|
||||
PageInfo<SupCertEntity> pageInfo;
|
||||
pageInfo = new PageInfo<>(supCertEntityList);
|
||||
PageSimpleResponse<SupCertEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(supCertEntityList);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/sup/info/getCompanyCert")
|
||||
public BaseResponse getCompanyCert(FilterSupCertRequest filterSupCertRequest) {
|
||||
filterSupCertRequest.setCustomerId(getCustomerId());
|
||||
List<SupCertEntity> companyCertEntities = supCertService.getCompanyCert(filterSupCertRequest);
|
||||
PageInfo<SupCertEntity> pageInfo = new PageInfo<>(companyCertEntities);
|
||||
PageSimpleResponse<SupCertEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(companyCertEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/info/insertCompanyCert")
|
||||
public BaseResponse insertCompanyCert(@RequestBody SupCertEntity supCertEntity) {
|
||||
supCertEntity.setCreateTime(new Date());
|
||||
supCertEntity.setUpdateTime(new Date());
|
||||
boolean b = supCertService.insertCompanyCert(supCertEntity);
|
||||
return ResultVOUtils.success("成功");
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sale/sup/cert/audit")
|
||||
public BaseResponse auditSupCert(@RequestBody SupCertEntity supCertEntity) {
|
||||
supCertEntity.setCreateTime(new Date());
|
||||
supCertEntity.setUpdateTime(new Date());
|
||||
boolean b = supCertService.updateCompanyCert(supCertEntity);
|
||||
return ResultVOUtils.success("成功");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/info/updateCompanyCert")
|
||||
public BaseResponse updateCompanyCert(@RequestBody SupCertEntity supCertEntity) {
|
||||
|
||||
boolean b = supCertService.updateCompanyCert(supCertEntity);
|
||||
return ResultVOUtils.success("修改成功");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/info/deleteCompanyCert")
|
||||
public BaseResponse deleteCompanyCert(@RequestBody DeleteCompanyFileRequest deleteCompanyFileRequest, BindingResult bindingResult) {
|
||||
boolean b = supCertService.deleteById(deleteCompanyFileRequest.getId());
|
||||
String URL = filePath + "/register/file/image2/" + deleteCompanyFileRequest.getFilePath();
|
||||
File file = new File(URL);
|
||||
if (file.exists() && file.isFile()) {
|
||||
file.delete();
|
||||
}
|
||||
return ResultVOUtils.success("成功");
|
||||
}
|
||||
|
||||
public String getCustomerId() {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (attributes == null) {
|
||||
throw new JsonException(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
String userId = request.getHeader("ADMIN_ID");
|
||||
AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId));
|
||||
return authAdmin.getCustomerId() + "";
|
||||
}
|
||||
}
|
@ -0,0 +1,193 @@
|
||||
package com.glxp.sale.admin.controller.purechase;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.extra.pinyin.PinyinUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.sale.admin.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.sale.admin.constant.ConstantStatus;
|
||||
import com.glxp.sale.admin.entity.auth.AuthAdmin;
|
||||
import com.glxp.sale.admin.entity.auth.CustomerContactEntity;
|
||||
import com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity;
|
||||
import com.glxp.sale.admin.entity.purchase.SupCertEntity;
|
||||
import com.glxp.sale.admin.entity.purchase.SupCompanyEntity;
|
||||
import com.glxp.sale.admin.exception.JsonException;
|
||||
import com.glxp.sale.admin.req.info.DeleteRequest;
|
||||
import com.glxp.sale.admin.req.purchase.FilterSupCertRequest;
|
||||
import com.glxp.sale.admin.req.purchase.FilterSupCompanyRequest;
|
||||
import com.glxp.sale.admin.res.PageSimpleResponse;
|
||||
import com.glxp.sale.admin.service.auth.AuthAdminService;
|
||||
import com.glxp.sale.admin.service.auth.impl.CustomerContactService;
|
||||
import com.glxp.sale.admin.service.basic.BasicUnitMaintainService;
|
||||
import com.glxp.sale.admin.service.purchase.SupCertService;
|
||||
import com.glxp.sale.admin.service.purchase.SupCompanyService;
|
||||
import com.glxp.sale.admin.util.CustomUtil;
|
||||
import com.glxp.sale.common.enums.ResultEnum;
|
||||
import com.glxp.sale.common.res.BaseResponse;
|
||||
import com.glxp.sale.common.util.ResultVOUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
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 org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class SupCompanyController {
|
||||
|
||||
@Value("${file_path}")
|
||||
private String filePath;
|
||||
|
||||
@Resource
|
||||
private AuthAdminService authAdminService;
|
||||
@Resource
|
||||
private SupCompanyService companyService;
|
||||
@Resource
|
||||
private CustomerContactService customerContactService;
|
||||
@Resource
|
||||
private SupCertService supCertService;
|
||||
@Resource
|
||||
BasicUnitMaintainService basicUnitMaintainService;
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/api/pur/getSupComapnys")
|
||||
public BaseResponse getSupComapnys(FilterSupCompanyRequest companyRequest) {
|
||||
List<SupCompanyEntity> companyEntities = companyService.filterCompany(companyRequest);
|
||||
PageInfo<SupCompanyEntity> pageInfo = new PageInfo<>(companyEntities);
|
||||
PageSimpleResponse<SupCompanyEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(companyEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/api/pur/addCompany")
|
||||
public BaseResponse insertCompany(@RequestBody SupCompanyEntity companyEntity) {
|
||||
|
||||
String customerId = CustomUtil.getId(); //重新生成customerId
|
||||
CustomerContactEntity customerContactEntity = new CustomerContactEntity();
|
||||
customerContactEntity.setTel(companyEntity.getTel());
|
||||
customerContactEntity.setMobile(companyEntity.getMobile());
|
||||
customerContactEntity.setEmail(companyEntity.getEmail());
|
||||
customerContactEntity.setContacts(companyEntity.getContacts());
|
||||
customerContactEntity.setCustomerId(customerId);
|
||||
customerContactService.insertCustomerContact(customerContactEntity);
|
||||
//更新相关证书对应的customerId
|
||||
supCertService.updateCustomerId(companyEntity.getCustomerId(), customerId);
|
||||
companyEntity.setCustomerId(customerId);
|
||||
|
||||
companyEntity.setCreateTime(new Date());
|
||||
companyEntity.setUpdateTime(new Date());
|
||||
AuthAdmin authAdmin = getUser();
|
||||
companyEntity.setCreateBy(authAdmin.getId() + "");
|
||||
boolean b = companyService.insertCompany(companyEntity);
|
||||
return ResultVOUtils.success("修改成功");
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/api/pur/modifyCompany")
|
||||
public BaseResponse modifyCompany(@RequestBody SupCompanyEntity companyEntity) {
|
||||
companyEntity.setUpdateTime(new Date());
|
||||
boolean b = companyService.modifyCompany(companyEntity);
|
||||
CustomerContactEntity customerContactEntity = new CustomerContactEntity();
|
||||
customerContactEntity.setTel(companyEntity.getTel());
|
||||
customerContactEntity.setMobile(companyEntity.getMobile());
|
||||
customerContactEntity.setEmail(companyEntity.getEmail());
|
||||
customerContactEntity.setContacts(companyEntity.getContacts());
|
||||
customerContactEntity.setCustomerId(companyEntity.getCustomerId());
|
||||
customerContactService.updateCustomerContact(customerContactEntity);
|
||||
return ResultVOUtils.success("修改成功");
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/api/pur/auditCompany")
|
||||
public BaseResponse auditCompany(@RequestBody SupCompanyEntity companyEntity) {
|
||||
|
||||
|
||||
//查询是否包含审核未通过的证书
|
||||
if (companyEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS
|
||||
|| companyEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE_PASS) {
|
||||
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
|
||||
filterSupCertRequest.setAuditStatus(24);
|
||||
filterSupCertRequest.setCustomerId(companyEntity.getCustomerId());
|
||||
filterSupCertRequest.setType(ConstantStatus.CERT_COMPANY);
|
||||
List<SupCertEntity> supCertEntityList = supCertService.filterCompanyCert(filterSupCertRequest);
|
||||
if (CollUtil.isNotEmpty(supCertEntityList)) {
|
||||
return ResultVOUtils.error(500, "审核失败,剩余" + supCertEntityList.size() + "个证书还未审核或审核未通过!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
AuthAdmin authAdmin = getUser();
|
||||
companyEntity.setAuditor(authAdmin.getId() + "");
|
||||
companyEntity.setAuditTime(new Date());
|
||||
companyEntity.setUpdateTime(new Date());
|
||||
boolean b = companyService.modifyCompany(companyEntity);
|
||||
CustomerContactEntity customerContactEntity = new CustomerContactEntity();
|
||||
customerContactEntity.setTel(companyEntity.getTel());
|
||||
customerContactEntity.setMobile(companyEntity.getMobile());
|
||||
customerContactEntity.setEmail(companyEntity.getEmail());
|
||||
customerContactEntity.setContacts(companyEntity.getContacts());
|
||||
customerContactEntity.setCustomerId(companyEntity.getCustomerId());
|
||||
customerContactService.updateCustomerContact(customerContactEntity);
|
||||
|
||||
BasicUnitMaintainEntity basicUnitMaintainEntity = new BasicUnitMaintainEntity();
|
||||
basicUnitMaintainEntity.setErpId(companyEntity.getCustomerId());
|
||||
basicUnitMaintainEntity.setName(companyEntity.getCompanyName());
|
||||
basicUnitMaintainEntity.setSpell(PinyinUtil.getFirstLetter(companyEntity.getCompanyName(), ""));
|
||||
basicUnitMaintainEntity.setAddr(companyEntity.getArea() + companyEntity.getDetailAddr());
|
||||
basicUnitMaintainEntity.setCreditNo(companyEntity.getCreditNum());
|
||||
basicUnitMaintainEntity.setContact(companyEntity.getContacts());
|
||||
basicUnitMaintainEntity.setMobile(companyEntity.getMobile());
|
||||
basicUnitMaintainEntity.setCorpType(ConstantStatus.CORP_SP);
|
||||
basicUnitMaintainEntity.setUpdateTime(new Date());
|
||||
basicUnitMaintainService.insertBasicUnitMaintain(basicUnitMaintainEntity);
|
||||
|
||||
return ResultVOUtils.success("修改成功");
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("api/pur/supCompany/delete")
|
||||
public BaseResponse deleteSupCompany(@RequestBody DeleteRequest deleteRequest) {
|
||||
boolean b = customerContactService.deleteById(Long.parseLong(deleteRequest.getId()));
|
||||
if (b)
|
||||
return ResultVOUtils.success("删除成功");
|
||||
else {
|
||||
return ResultVOUtils.error(500, "删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getCustomerId() {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (attributes == null) {
|
||||
throw new JsonException(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
String userId = request.getHeader("ADMIN_ID");
|
||||
AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId));
|
||||
return authAdmin.getCustomerId() + "";
|
||||
}
|
||||
|
||||
public AuthAdmin getUser() {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (attributes == null) {
|
||||
throw new JsonException(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
String userId = request.getHeader("ADMIN_ID");
|
||||
AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId));
|
||||
return authAdmin;
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.glxp.sale.admin.dao.purchase;
|
||||
|
||||
import com.glxp.sale.admin.entity.purchase.SupCertEntity;
|
||||
import com.glxp.sale.admin.req.purchase.FilterSupCertRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SupCertDao {
|
||||
|
||||
List<SupCertEntity> filterCompanyCert(FilterSupCertRequest filterSupCertRequest);
|
||||
|
||||
|
||||
SupCertEntity findCompanyCertByName(String name);
|
||||
|
||||
List<SupCertEntity> getCompanyCert(FilterSupCertRequest filterSupCertRequest);
|
||||
|
||||
boolean updateCompanyCert(SupCertEntity supCertEntity);
|
||||
|
||||
boolean insertCompanyCert(SupCertEntity supCertEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean updateCustomerId(@Param("oldId") String oldId, @Param("newId") String newId);
|
||||
|
||||
boolean updateManufacturerId(@Param("oldCustomerId") String oldCustomerId, @Param("newCustomerId") String newCustomerId,
|
||||
@Param("oldManufacturerIdFk") String oldManufacturerIdFk, @Param("newManufacturerIdFk") String newManufacturerIdFk);
|
||||
|
||||
boolean updateProductId(@Param("oldCustomerId") String oldCustomerId, @Param("newCustomerId") String newCustomerId,
|
||||
@Param("oldManufacturerIdFk") String oldManufacturerIdFk, @Param("newManufacturerIdFk") String newManufacturerIdFk,
|
||||
@Param("oldProductIdFk") String oldProductIdFk, @Param("newProductIdFk") String newProductIdFk);
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.glxp.sale.admin.dao.purchase;
|
||||
|
||||
import com.glxp.sale.admin.entity.purchase.SupCompanyEntity;
|
||||
import com.glxp.sale.admin.req.purchase.FilterSupCompanyRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SupCompanyDao {
|
||||
|
||||
SupCompanyEntity findCompany(String CustomerId);
|
||||
|
||||
SupCompanyEntity findCompanyByName(String companyName);
|
||||
|
||||
List<SupCompanyEntity> getSubCompany(FilterSupCompanyRequest companyRequest);
|
||||
|
||||
List<SupCompanyEntity> getSubCompany2(FilterSupCompanyRequest companyRequest);
|
||||
|
||||
List<SupCompanyEntity> filterCompany(FilterSupCompanyRequest companyRequest);
|
||||
|
||||
boolean modifyCompany(SupCompanyEntity companyEntity);
|
||||
|
||||
boolean insertCompany(SupCompanyEntity companyEntity);
|
||||
|
||||
boolean deleteCompany(Long customerId);
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.glxp.sale.admin.dao.purchase;
|
||||
|
||||
import com.glxp.sale.admin.entity.purchase.SupManufacturerEntity;
|
||||
import com.glxp.sale.admin.req.purchase.FilterSupManufacturerRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SupManufacturerDao {
|
||||
|
||||
SupManufacturerEntity findCompany(Long id);
|
||||
|
||||
SupManufacturerEntity findCompanyByName(String companyName);
|
||||
|
||||
List<SupManufacturerEntity> getCompany(FilterSupManufacturerRequest filterSupManufacturerRequest);
|
||||
|
||||
boolean modifyCompany(SupManufacturerEntity supManufacturerEntity);
|
||||
|
||||
boolean insertCompany(SupManufacturerEntity supManufacturerEntity);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.glxp.sale.admin.dao.purchase;
|
||||
|
||||
import com.glxp.sale.admin.entity.purchase.SupProductEntity;
|
||||
import com.glxp.sale.admin.req.purchase.FilterPoductRequest;
|
||||
import com.glxp.sale.admin.res.purchase.SupProductResponse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SupProductDao {
|
||||
|
||||
SupProductEntity findRegistration(Long id);
|
||||
|
||||
SupProductEntity findRegistrationByName(String recordProductName);
|
||||
|
||||
List<SupProductResponse> getRegistration(FilterPoductRequest filterPoductRequest);
|
||||
|
||||
boolean modifyRegistration(SupProductEntity supProductEntity);
|
||||
|
||||
boolean insertRegistration(SupProductEntity supProductEntity);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteByEnterpriseId(@Param("enterpriseId") String enterpriseId);
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.glxp.sale.admin.entity.purchase;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CustomerContactEntity {
|
||||
|
||||
private Long id;
|
||||
private String customerId;
|
||||
private String contacts;
|
||||
private String mobile;
|
||||
private String tel;
|
||||
private String email;
|
||||
private String comments;
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.glxp.sale.admin.entity.purchase;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class SupManufacturerEntity {
|
||||
|
||||
private Long id;
|
||||
private String companyName;
|
||||
private String creditCode;
|
||||
private String companyType;
|
||||
private String placeArea;
|
||||
private String placeAreaCode;
|
||||
private String placeAddress;
|
||||
private String detailAddr;
|
||||
private String legalPersonName;
|
||||
private String legalPersonPapersType;
|
||||
private String legalPersonPapersCode;
|
||||
private String productionArea;
|
||||
private String productionAreaCode;
|
||||
private String productionAddress;
|
||||
private String registerStatus;
|
||||
private String productionLicenceNum;
|
||||
private Date productionLicenceDate;
|
||||
private String productionRecordNum;
|
||||
private String productionRecordSection;
|
||||
private Date productionRecordDate;
|
||||
private String remark;
|
||||
private Date createDate;
|
||||
private Date updateDate;
|
||||
private String customerId;
|
||||
private String manufacturerId;
|
||||
|
||||
private Integer auditStatus;
|
||||
private String supName;
|
||||
private String auditComment;
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.glxp.sale.admin.entity.purchase;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class SupProductEntity {
|
||||
|
||||
private Long id;
|
||||
private String productId;
|
||||
private Long enterpriseId;
|
||||
private String recordCode;
|
||||
private String recordProductName;
|
||||
private String productManageType;
|
||||
private String recordPeopleName;
|
||||
private String recordPeopleArea;
|
||||
private String recordPeopleAreaCode;
|
||||
private String recordPeopleAddress;
|
||||
private String productType;
|
||||
private String productDirectoryCode;
|
||||
private String agentName;
|
||||
private String agentArea;
|
||||
private String agentAreaCode;
|
||||
private String agentAddress;
|
||||
private String instructions;
|
||||
private String productAddress;
|
||||
private String recordText;
|
||||
private String placeOrigin;
|
||||
private String productionRegion;
|
||||
private String productionCompanyName;
|
||||
private String afterSale;
|
||||
private String specification;
|
||||
private String structure;
|
||||
private String scope;
|
||||
private String other;
|
||||
private String filePath;
|
||||
private String remark;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date create_date;
|
||||
private Date update_date;
|
||||
|
||||
private String newFilePath;
|
||||
private String newInstructions;
|
||||
|
||||
private String manufacturerIdFk;
|
||||
private String customerId;
|
||||
|
||||
|
||||
private Integer auditStatus;
|
||||
private String auditComment;
|
||||
private String sptm;
|
||||
private String ybbm;
|
||||
private String measname;
|
||||
private String cpms;
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.glxp.sale.admin.req.purchase;
|
||||
|
||||
import com.glxp.sale.admin.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FilterPoductRequest extends ListPageRequest {
|
||||
|
||||
private Long id;
|
||||
private Long enterpriseId;
|
||||
private String recordCode;
|
||||
private String recordProductName;
|
||||
private String recordPeopleName;
|
||||
|
||||
|
||||
private String productId;
|
||||
private String manufacturerIdFk;
|
||||
private String customerId;
|
||||
private Integer auditStatus;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.glxp.sale.admin.req.purchase;
|
||||
|
||||
import com.glxp.sale.admin.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FilterSupCertRequest extends ListPageRequest {
|
||||
|
||||
private String code;
|
||||
private String customerId;
|
||||
private String name;
|
||||
private String manufacturerIdFk;
|
||||
private String productIdFk;
|
||||
private Integer auditStatus;
|
||||
private Integer type;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.glxp.sale.admin.req.purchase;
|
||||
|
||||
import com.glxp.sale.admin.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FilterSupCompanyRequest extends ListPageRequest {
|
||||
|
||||
private String customerId;
|
||||
private String companyName;
|
||||
private String creditNum;
|
||||
private String auditStatus;
|
||||
private String unitIdFk;
|
||||
|
||||
private List<String> auditStatusList;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.glxp.sale.admin.req.purchase;
|
||||
|
||||
import com.glxp.sale.admin.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FilterSupManufacturerRequest extends ListPageRequest {
|
||||
|
||||
private Long id;
|
||||
private String companyName;
|
||||
private String creditCode;
|
||||
private String placeArea;
|
||||
private String customerId;
|
||||
private Integer auditStatus;
|
||||
private String manufacturerId;
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.glxp.sale.admin.res.purchase;
|
||||
|
||||
import com.glxp.sale.admin.entity.purchase.SupProductEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SupProductResponse extends SupProductEntity {
|
||||
|
||||
|
||||
private String supName;
|
||||
private String manufacturerName;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.glxp.sale.admin.service.purchase;
|
||||
|
||||
|
||||
import com.glxp.sale.admin.entity.purchase.SupCertEntity;
|
||||
import com.glxp.sale.admin.req.purchase.FilterSupCertRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SupCertService {
|
||||
|
||||
List<SupCertEntity> filterCompanyCert(FilterSupCertRequest filterSupCertRequest);
|
||||
|
||||
SupCertEntity findCompanyCertByName(String name);
|
||||
|
||||
List<SupCertEntity> getCompanyCert(FilterSupCertRequest filterSupCertRequest);
|
||||
|
||||
boolean updateCompanyCert(SupCertEntity supCertEntity);
|
||||
|
||||
boolean updateCustomerId(String oldId, String newId);
|
||||
|
||||
boolean updateManufacturerId(String oldCustomerId, String newCustomerId, String oldManufacturerIdFk, String newManufacturerIdFk);
|
||||
|
||||
boolean updateProductId(String oldCustomerId, String newCustomerId, String oldManufacturerIdFk, String newManufacturerIdFk, String oldProductIdFk, String newProductIdFk);
|
||||
|
||||
boolean insertCompanyCert(SupCertEntity supCertEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.glxp.sale.admin.service.purchase;
|
||||
|
||||
|
||||
|
||||
import com.glxp.sale.admin.entity.purchase.SupCompanyEntity;
|
||||
import com.glxp.sale.admin.req.purchase.FilterSupCompanyRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SupCompanyService {
|
||||
|
||||
SupCompanyEntity findCompanyByUnitFk(String unitFk);
|
||||
|
||||
List<SupCompanyEntity> filterCompany(FilterSupCompanyRequest companyRequest);
|
||||
|
||||
SupCompanyEntity findCompany(String CustomerId);
|
||||
|
||||
List<SupCompanyEntity> getSubCompany(FilterSupCompanyRequest commitRequest);
|
||||
|
||||
List<SupCompanyEntity> getSubCompany2(FilterSupCompanyRequest commitRequest);
|
||||
|
||||
SupCompanyEntity findCompanyByName(String companyName);
|
||||
|
||||
boolean modifyCompany(SupCompanyEntity companyEntity);
|
||||
|
||||
boolean insertCompany(SupCompanyEntity companyEntity);
|
||||
|
||||
|
||||
boolean deleteCompany(Long customerId);
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.glxp.sale.admin.service.purchase;
|
||||
|
||||
|
||||
|
||||
import com.glxp.sale.admin.entity.purchase.SupManufacturerEntity;
|
||||
import com.glxp.sale.admin.req.purchase.FilterSupManufacturerRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SupManufacturerService {
|
||||
|
||||
SupManufacturerEntity findCompany(Long id);
|
||||
|
||||
SupManufacturerEntity findCompanyByName(String companyName);
|
||||
|
||||
List<SupManufacturerEntity> getCompany(FilterSupManufacturerRequest filterSupManufacturerRequest);
|
||||
|
||||
boolean modifyCompany(SupManufacturerEntity supManufacturerEntity);
|
||||
|
||||
boolean insertCompany(SupManufacturerEntity supManufacturerEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.glxp.sale.admin.service.purchase;
|
||||
|
||||
import com.glxp.sale.admin.entity.purchase.SupProductEntity;
|
||||
import com.glxp.sale.admin.req.purchase.FilterPoductRequest;
|
||||
import com.glxp.sale.admin.res.purchase.SupProductResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SupProductService {
|
||||
|
||||
SupProductEntity findRegistration(Long id);
|
||||
|
||||
SupProductResponse findJoinRegistration(Long id);
|
||||
|
||||
SupProductEntity findRegistrationByName(String recordProductName);
|
||||
|
||||
List<SupProductResponse> getRegistration(FilterPoductRequest filterPoductRequest);
|
||||
|
||||
boolean modifyRegistration(SupProductEntity supProductEntity);
|
||||
|
||||
boolean insertRegistration(SupProductEntity supProductEntity);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteByEnterpriseId(@Param("enterpriseId") String enterpriseId);
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package com.glxp.sale.admin.service.purchase.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.sale.admin.dao.purchase.SupCertDao;
|
||||
import com.glxp.sale.admin.entity.purchase.SupCertEntity;
|
||||
import com.glxp.sale.admin.req.purchase.FilterSupCertRequest;
|
||||
import com.glxp.sale.admin.service.purchase.SupCertService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SupCertServiceImpl implements SupCertService {
|
||||
|
||||
@Resource
|
||||
SupCertDao supCertDao;
|
||||
|
||||
@Override
|
||||
public List<SupCertEntity> filterCompanyCert(FilterSupCertRequest filterSupCertRequest) {
|
||||
if (filterSupCertRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterSupCertRequest.getPage() != null) {
|
||||
int offset = (filterSupCertRequest.getPage() - 1) * filterSupCertRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterSupCertRequest.getLimit());
|
||||
}
|
||||
return supCertDao.filterCompanyCert(filterSupCertRequest);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SupCertEntity> getCompanyCert(FilterSupCertRequest filterSupCertRequest) {
|
||||
if (filterSupCertRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
int offset = (filterSupCertRequest.getPage() - 1) * filterSupCertRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterSupCertRequest.getLimit());
|
||||
List<SupCertEntity> companyEntities = supCertDao.getCompanyCert(filterSupCertRequest);
|
||||
return companyEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupCertEntity findCompanyCertByName(String companyName) {
|
||||
return supCertDao.findCompanyCertByName(companyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateCompanyCert(SupCertEntity supCertEntity) {
|
||||
return supCertDao.updateCompanyCert(supCertEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateCustomerId(String oldId, String newId) {
|
||||
return supCertDao.updateCustomerId(oldId, newId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateManufacturerId(String oldCustomerId, String newCustomerId, String oldManufacturerIdFk, String newManufacturerIdFk) {
|
||||
return supCertDao.updateManufacturerId(oldCustomerId, newCustomerId, oldManufacturerIdFk, newManufacturerIdFk);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateProductId(String oldCustomerId, String newCustomerId, String oldManufacturerIdFk, String newManufacturerIdFk, String oldProductIdFk, String newProductIdFk) {
|
||||
return supCertDao.updateProductId(oldCustomerId, newCustomerId, oldManufacturerIdFk, newManufacturerIdFk, oldProductIdFk, newProductIdFk);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertCompanyCert(SupCertEntity supCertEntity) {
|
||||
return supCertDao.insertCompanyCert(supCertEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return supCertDao.deleteById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.glxp.sale.admin.service.purchase.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.sale.admin.dao.purchase.SupCompanyDao;
|
||||
import com.glxp.sale.admin.entity.purchase.SupCompanyEntity;
|
||||
import com.glxp.sale.admin.req.purchase.FilterSupCompanyRequest;
|
||||
import com.glxp.sale.admin.service.purchase.SupCompanyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SupCompanyServiceImpl implements SupCompanyService {
|
||||
|
||||
@Resource
|
||||
SupCompanyDao supCompanyDao;
|
||||
|
||||
@Override
|
||||
public SupCompanyEntity findCompanyByUnitFk(String unitFk) {
|
||||
FilterSupCompanyRequest filterSupCompanyRequest = new FilterSupCompanyRequest();
|
||||
filterSupCompanyRequest.setUnitIdFk(unitFk);
|
||||
List<SupCompanyEntity> companyEntities = supCompanyDao.filterCompany(filterSupCompanyRequest);
|
||||
if (companyEntities != null && companyEntities.size() > 0) {
|
||||
return companyEntities.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupCompanyEntity> filterCompany(FilterSupCompanyRequest companyRequest) {
|
||||
return supCompanyDao.filterCompany(companyRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupCompanyEntity findCompany(String CustomerId) {
|
||||
return supCompanyDao.findCompany(CustomerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupCompanyEntity> getSubCompany(FilterSupCompanyRequest commitRequest) {
|
||||
if (commitRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
int offset = (commitRequest.getPage() - 1) * commitRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, commitRequest.getLimit());
|
||||
List<SupCompanyEntity> companyEntities = supCompanyDao.getSubCompany(commitRequest);
|
||||
return companyEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupCompanyEntity> getSubCompany2(FilterSupCompanyRequest commitRequest) {
|
||||
if (commitRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
int offset = (commitRequest.getPage() - 1) * commitRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, commitRequest.getLimit());
|
||||
List<SupCompanyEntity> companyEntities = supCompanyDao.getSubCompany2(commitRequest);
|
||||
return companyEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupCompanyEntity findCompanyByName(String companyName) {
|
||||
return supCompanyDao.findCompanyByName(companyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifyCompany(SupCompanyEntity companyEntity) {
|
||||
return supCompanyDao.modifyCompany(companyEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertCompany(SupCompanyEntity companyEntity) {
|
||||
return supCompanyDao.insertCompany(companyEntity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean deleteCompany(Long customerId) {
|
||||
return supCompanyDao.deleteCompany(customerId);
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.glxp.sale.admin.service.purchase.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.sale.admin.dao.purchase.SupManufacturerDao;
|
||||
import com.glxp.sale.admin.entity.purchase.SupManufacturerEntity;
|
||||
import com.glxp.sale.admin.req.purchase.FilterSupManufacturerRequest;
|
||||
import com.glxp.sale.admin.service.purchase.SupManufacturerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SupManufacturerServiceImpl implements SupManufacturerService {
|
||||
|
||||
@Resource
|
||||
SupManufacturerDao supManufacturerDao;
|
||||
|
||||
@Override
|
||||
public SupManufacturerEntity findCompany(Long id) {
|
||||
return supManufacturerDao.findCompany(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupManufacturerEntity findCompanyByName(String companyName) {
|
||||
return supManufacturerDao.findCompanyByName(companyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupManufacturerEntity> getCompany(FilterSupManufacturerRequest filterSupManufacturerRequest) {
|
||||
if (filterSupManufacturerRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
int offset = (filterSupManufacturerRequest.getPage() - 1) * filterSupManufacturerRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterSupManufacturerRequest.getLimit());
|
||||
List<SupManufacturerEntity> companyEntities = supManufacturerDao.getCompany(filterSupManufacturerRequest);
|
||||
return companyEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifyCompany(SupManufacturerEntity companyEntity) {
|
||||
return supManufacturerDao.modifyCompany(companyEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertCompany(SupManufacturerEntity companyEntity) {
|
||||
return supManufacturerDao.insertCompany(companyEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return supManufacturerDao.deleteById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.glxp.sale.admin.service.purchase.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.sale.admin.dao.purchase.SupProductDao;
|
||||
import com.glxp.sale.admin.entity.purchase.SupProductEntity;
|
||||
import com.glxp.sale.admin.req.purchase.FilterPoductRequest;
|
||||
import com.glxp.sale.admin.res.purchase.SupProductResponse;
|
||||
import com.glxp.sale.admin.service.purchase.SupProductService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SupProductServiceImpl implements SupProductService {
|
||||
|
||||
@Resource
|
||||
SupProductDao supProductDao;
|
||||
|
||||
@Override
|
||||
public SupProductEntity findRegistration(Long id) {
|
||||
return supProductDao.findRegistration(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupProductResponse findJoinRegistration(Long id) {
|
||||
if (id == null)
|
||||
return null;
|
||||
FilterPoductRequest filterPoductRequest = new FilterPoductRequest();
|
||||
filterPoductRequest.setId(id);
|
||||
List<SupProductResponse> companyEntities = supProductDao.getRegistration(filterPoductRequest);
|
||||
if (CollUtil.isNotEmpty(companyEntities))
|
||||
return companyEntities.get(0);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupProductEntity findRegistrationByName(String recordProductName) {
|
||||
return supProductDao.findRegistrationByName(recordProductName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupProductResponse> getRegistration(FilterPoductRequest filterPoductRequest) {
|
||||
if (filterPoductRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterPoductRequest.getPage() != null) {
|
||||
int offset = (filterPoductRequest.getPage() - 1) * filterPoductRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterPoductRequest.getLimit());
|
||||
}
|
||||
List<SupProductResponse> companyEntities = supProductDao.getRegistration(filterPoductRequest);
|
||||
return companyEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifyRegistration(SupProductEntity companyEntity) {
|
||||
return supProductDao.modifyRegistration(companyEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertRegistration(SupProductEntity companyEntity) {
|
||||
return supProductDao.insertRegistration(companyEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return supProductDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByEnterpriseId(String enterpriseId) {
|
||||
return supProductDao.deleteByEnterpriseId(enterpriseId);
|
||||
}
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
<?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.purchase.SupCertDao">
|
||||
|
||||
<select id="filterCompanyCert" parameterType="com.glxp.sale.admin.req.purchase.FilterSupCertRequest"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupCertEntity">
|
||||
select * from sup_cert
|
||||
<where>
|
||||
<if test="customerId != '' and customerId!=null">
|
||||
and customerId = #{customerId}
|
||||
</if>
|
||||
<if test="manufacturerIdFk != '' and manufacturerIdFk!=null">
|
||||
and manufacturerIdFk = #{manufacturerIdFk}
|
||||
</if>
|
||||
<if test="productIdFk != '' and productIdFk!=null">
|
||||
and productIdFk = #{productIdFk}
|
||||
</if>
|
||||
<if test="type != '' and type!=null">
|
||||
and `type` = #{type}
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus !=23 and auditStatus !=24">
|
||||
and auditStatus = #{auditStatus}
|
||||
</if>
|
||||
<if test="auditStatus ==20">
|
||||
and (auditStatus = 1 or auditStatus=4)
|
||||
</if>
|
||||
<if test="auditStatus ==24">
|
||||
and (auditStatus = 2 or auditStatus=3 or auditStatus=5 or auditStatus=6)
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="findCompanyCertByName" parameterType="java.lang.String"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupCertEntity">
|
||||
SELECT *
|
||||
FROM sup_cert
|
||||
where name = #{name}
|
||||
</select>
|
||||
|
||||
<select id="getCompanyCert" parameterType="com.glxp.sale.admin.req.purchase.FilterSupCertRequest"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupCertEntity">
|
||||
SELECT * FROM sup_cert
|
||||
<where>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and customerId = #{customerId}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and name like concat('%',#{name},'%')
|
||||
</if>
|
||||
<if test="manufacturerIdFk != null and manufacturerIdFk != ''">
|
||||
and manufacturerIdFk = #{manufacturerIdFk}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<update id="updateCompanyCert" parameterType="com.glxp.sale.admin.entity.purchase.SupCertEntity">
|
||||
UPDATE sup_cert
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="name != null">name=#{name},</if>
|
||||
<if test="customerId != null">customerId=#{customerId},</if>
|
||||
<if test="filePath != null">filePath=#{filePath},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
<if test="createTime != null">createTime=#{createTime},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="vailDate != null">vailDate=#{vailDate},</if>
|
||||
<if test="expireDate != null">expireDate=#{expireDate},</if>
|
||||
<if test="type != null">`type`=#{type},</if>
|
||||
<if test="manufacturerIdFk != null">`manufacturerIdFk`=#{manufacturerIdFk},</if>
|
||||
<if test="productIdFk != null">`productIdFk`=#{productIdFk},</if>
|
||||
<if test="code != null">`code`=#{code},</if>
|
||||
<if test="auditStatus != null">`auditStatus`=#{auditStatus},</if>
|
||||
<if test="auditComment != null">`auditComment`=#{auditComment},</if>
|
||||
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateCustomerId" parameterType="Map">
|
||||
UPDATE sup_cert
|
||||
set customerId = #{newId}
|
||||
WHERE customerId = #{oldId}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateManufacturerId" parameterType="Map">
|
||||
UPDATE sup_cert
|
||||
set customerId = #{newCustomerId}
|
||||
, manufacturerIdFk = #{newManufacturerIdFk}
|
||||
WHERE customerId = #{oldCustomerId}
|
||||
and manufacturerIdFk = #{oldManufacturerIdFk}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateProductId" parameterType="Map">
|
||||
UPDATE sup_cert
|
||||
set customerId = #{newCustomerId}
|
||||
, manufacturerIdFk = #{newManufacturerIdFk}
|
||||
, productIdFk = #{newProductIdFk}
|
||||
WHERE customerId = #{oldCustomerId}
|
||||
and manufacturerIdFk = #{oldManufacturerIdFk}
|
||||
and productIdFk = #{oldProductIdFk}
|
||||
</update>
|
||||
|
||||
|
||||
<insert id="insertCompanyCert" parameterType="com.glxp.sale.admin.entity.purchase.SupCertEntity">
|
||||
INSERT INTO sup_cert( `name`, customerId, filePath, remark, createTime, updateTime
|
||||
, vailDate, expireDate, `type`, manufacturerIdFk, productIdFk, code, auditStatus
|
||||
, auditComment)
|
||||
values (#{name},
|
||||
#{customerId},
|
||||
#{filePath},
|
||||
#{remark},
|
||||
#{createTime},
|
||||
#{updateTime},
|
||||
#{vailDate},
|
||||
#{expireDate},
|
||||
#{type}, #{manufacturerIdFk}, #{productIdFk}, #{code}, #{auditStatus}, #{auditComment})
|
||||
</insert>
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM sup_cert
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,180 @@
|
||||
<?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.purchase.SupCompanyDao">
|
||||
|
||||
|
||||
<select id="findCompany" parameterType="java.lang.String"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupCompanyEntity">
|
||||
SELECT *
|
||||
FROM sup_company
|
||||
where customerId = #{CustomerId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="filterCompany" parameterType="com.glxp.sale.admin.req.purchase.FilterSupCompanyRequest"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupCompanyEntity">
|
||||
SELECT * FROM sup_company
|
||||
<where>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and parentIdFk = #{customerId}
|
||||
</if>
|
||||
<if test="companyName != null and companyName != ''">
|
||||
and companyName like concat('%',#{companyName},'%')
|
||||
</if>
|
||||
<if test="creditNum != null and creditNum != ''">
|
||||
and creditNum like ('%',#{creditNum},'%')
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=21 and auditStatus !=22">
|
||||
and auditStatus = #{auditStatus}
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==20">
|
||||
and (auditStatus = 0 or auditStatus=5 or auditStatus=2)
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==21">
|
||||
and <![CDATA[ auditStatus <> 0 ]]>
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==22">
|
||||
and (auditStatus = 1 or auditStatus=4 )
|
||||
</if>
|
||||
|
||||
<if test="unitIdFk != null and unitIdFk != ''">
|
||||
and unitIdFk = #{unitIdFk}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<delete id="deleteCompany" parameterType="java.lang.Long">
|
||||
delete
|
||||
from sup_company
|
||||
where customerId = #{customerId}
|
||||
</delete>
|
||||
|
||||
<select id="findCompanyByName" parameterType="java.lang.String"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupCompanyEntity">
|
||||
|
||||
SELECT *
|
||||
FROM sup_company
|
||||
where companyName = #{companyName}
|
||||
</select>
|
||||
|
||||
<select id="getSubCompany" parameterType="com.glxp.sale.admin.req.purchase.FilterSupCompanyRequest"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupCompanyEntity">
|
||||
SELECT * FROM sup_company
|
||||
<where>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and parentIdFk = #{customerId}
|
||||
</if>
|
||||
<if test="companyName != null and companyName != ''">
|
||||
and companyName like concat('%',#{companyName},'%')
|
||||
</if>
|
||||
<if test="creditNum != null and creditNum != ''">
|
||||
and creditNum like concat('%',#{creditNum},'%')
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus != ''">
|
||||
and auditStatus = #{auditStatus}
|
||||
</if>
|
||||
<if test="unitIdFk != null and unitIdFk != ''">
|
||||
and unitIdFk = #{unitIdFk}
|
||||
</if>
|
||||
<if test="(auditStatus == null or auditStatus == '') and auditStatusList != null and auditStatusList.size() >0">
|
||||
<foreach collection="auditStatusList" item="auditStatus" open="AND (" separator="OR" close=")">
|
||||
auditStatus = #{auditStatus,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getSubCompany2" parameterType="com.glxp.sale.admin.req.purchase.FilterSupCompanyRequest"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupCompanyEntity">
|
||||
SELECT *
|
||||
FROM (company
|
||||
inner JOIN company_product_relevance
|
||||
ON company.customerId = company_product_relevance.customerId)
|
||||
inner JOIN company_salesman
|
||||
ON company.customerId = company_salesman.customerId
|
||||
<where>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and parentIdFk = #{customerId}
|
||||
</if>
|
||||
<if test="companyName != null and companyName != ''">
|
||||
and companyName like concat('%',#{companyName},'%')
|
||||
</if>
|
||||
<if test="creditNum != null and creditNum != ''">
|
||||
and creditNum like concat('%',#{creditNum},'%')
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus != ''">
|
||||
and (company.auditStatus = #{auditStatus}
|
||||
or company_product_relevance.auditStatus = #{auditStatus}
|
||||
or company_salesman.auditStatus = #{auditStatus})
|
||||
</if>
|
||||
<if test="(auditStatus == null or auditStatus == '') and auditStatusList != null and auditStatusList.size() >0">
|
||||
<foreach collection="auditStatusList" item="auditStatus" open="AND (" separator="OR" close=")">
|
||||
auditStatus = #{auditStatus,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="modifyCompany" parameterType="com.glxp.sale.admin.entity.purchase.SupCompanyEntity">
|
||||
|
||||
UPDATE sup_company
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="companyName != null">companyName=#{companyName},</if>
|
||||
<if test="bussinessStatus != null">bussinessStatus=#{bussinessStatus},</if>
|
||||
<if test="creditNum != null">creditNum=#{creditNum},</if>
|
||||
<if test="classes != null">classes=#{classes},</if>
|
||||
<if test="area != null">area=#{area},</if>
|
||||
<if test="detailAddr != null">detailAddr=#{detailAddr},</if>
|
||||
<if test="appId != null">appId=#{appId},</if>
|
||||
<if test="appSecret != null">appSecret=#{appSecret},</if>
|
||||
<if test="contacts != null">contacts=#{contacts},</if>
|
||||
<if test="mobile != null">mobile=#{mobile},</if>
|
||||
<if test="tel != null">tel=#{tel},</if>
|
||||
<if test="email != null">email=#{email},</if>
|
||||
<if test="areaCode != null">areaCode=#{areaCode},</if>
|
||||
<if test="auditStatus != null">auditStatus=#{auditStatus},</if>
|
||||
<if test="createTime != null">createTime=#{createTime},</if>
|
||||
<if test="createBy != null">createBy=#{createBy},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="auditTime != null">auditTime=#{auditTime},</if>
|
||||
<if test="auditComment != null">auditComment=#{auditComment},</if>
|
||||
<if test="editStatus != null">editStatus=#{editStatus},</if>
|
||||
|
||||
</trim>
|
||||
WHERE customerId=#{customerId}
|
||||
|
||||
|
||||
</update>
|
||||
|
||||
<insert id="insertCompany" parameterType="com.glxp.sale.admin.entity.purchase.SupCompanyEntity">
|
||||
INSERT INTO sup_company(companyName, bussinessStatus, creditNum, classes, area,
|
||||
detailAddr, appId, appSecret, contacts, mobile, tel, email, customerId, areaCode,
|
||||
auditStatus, unitIdFk, createTime, createBy, updateTime, auditTime, auditComment,
|
||||
editStatus)
|
||||
values (#{companyName},
|
||||
#{bussinessStatus},
|
||||
#{creditNum},
|
||||
#{classes},
|
||||
#{area},
|
||||
#{detailAddr},
|
||||
#{appId},
|
||||
#{appSecret},
|
||||
#{contacts},
|
||||
#{mobile},
|
||||
#{tel},
|
||||
#{email},
|
||||
#{customerId},
|
||||
#{areaCode},
|
||||
#{auditStatus},
|
||||
#{unitIdFk},
|
||||
#{createTime},
|
||||
#{createBy},
|
||||
#{updateTime},
|
||||
#{auditTime}, #{auditComment}, #{editStatus})
|
||||
</insert>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,124 @@
|
||||
<?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.purchase.SupManufacturerDao">
|
||||
|
||||
<select id="findCompany" parameterType="java.lang.Long"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupManufacturerEntity">
|
||||
SELECT *
|
||||
FROM sup_manufacturer
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="findCompanyByName" parameterType="java.lang.String"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupManufacturerEntity">
|
||||
SELECT *
|
||||
FROM sup_manufacturer
|
||||
where companyName = #{companyName}
|
||||
</select>
|
||||
|
||||
<select id="getCompany" parameterType="com.glxp.sale.admin.req.purchase.FilterSupManufacturerRequest"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupManufacturerEntity">
|
||||
SELECT sup_manufacturer.* ,sup_company.companyName supName FROM sup_manufacturer
|
||||
inner join sup_company on sup_manufacturer.customerId = sup_company.customerId
|
||||
<where>
|
||||
<if test="id != null and id != ''">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="manufacturerId != null and manufacturerId != ''">
|
||||
and manufacturerId = #{manufacturerId}
|
||||
</if>
|
||||
<if test="companyName != null and companyName != ''">
|
||||
and companyName like concat('%',#{companyName},'%')
|
||||
</if>
|
||||
<if test="creditCode != null and creditCode != ''">
|
||||
and creditCode like concat('%',#{creditCode},'%')
|
||||
</if>
|
||||
<if test="placeArea != null and placeArea != ''">
|
||||
and placeArea like concat('%',#{placeArea},'%')
|
||||
</if>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and sup_manufacturer.customerId = #{customerId}
|
||||
</if>
|
||||
|
||||
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=21 and auditStatus !=22">
|
||||
and sup_manufacturer.auditStatus = #{auditStatus}
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==20">
|
||||
and (sup_manufacturer.auditStatus = 0 or sup_manufacturer.auditStatus=5 or
|
||||
sup_manufacturer.auditStatus=2)
|
||||
</if>
|
||||
<if test="auditStatus ==21">
|
||||
and <![CDATA[ sup_manufacturer.auditStatus <> 0 ]]>
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==22">
|
||||
and (sup_manufacturer.auditStatus = 1 or sup_manufacturer.auditStatus=4 )
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="modifyCompany" parameterType="com.glxp.sale.admin.entity.purchase.SupManufacturerEntity">
|
||||
|
||||
UPDATE sup_manufacturer
|
||||
<set>
|
||||
<if test="companyName != null">companyName=#{companyName},</if>
|
||||
<if test="creditCode != null">creditCode=#{creditCode},</if>
|
||||
<if test="companyType != null">companyType=#{companyType},</if>
|
||||
<if test="placeArea != null">placeArea=#{placeArea},</if>
|
||||
<if test="placeAreaCode != null">placeAreaCode=#{placeAreaCode},</if>
|
||||
<if test="placeAddress != null">placeAddress=#{placeAddress},</if>
|
||||
<if test="legalPersonName != null">legalPersonName=#{legalPersonName},</if>
|
||||
<if test="legalPersonPapersType != null">legalPersonPapersType=#{legalPersonPapersType},</if>
|
||||
<if test="legalPersonPapersCode != null">legalPersonPapersCode=#{legalPersonPapersCode},</if>
|
||||
<if test="productionArea != null">productionArea=#{productionArea},</if>
|
||||
<if test="productionAreaCode != null">productionAreaCode=#{productionAreaCode},</if>
|
||||
<if test="productionAddress != null">productionAddress=#{productionAddress},</if>
|
||||
<if test="registerStatus != null">registerStatus=#{registerStatus},</if>
|
||||
<if test="productionLicenceNum != null">productionLicenceNum=#{productionLicenceNum},</if>
|
||||
<if test="productionLicenceDate != null">productionLicenceDate=#{productionLicenceDate},</if>
|
||||
<if test="productionRecordNum != null">productionRecordNum=#{productionRecordNum},</if>
|
||||
<if test="productionRecordSection != null">productionRecordSection=#{productionRecordSection},</if>
|
||||
<if test="productionRecordDate != null">productionRecordDate=#{productionRecordDate},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
<if test="createDate != null">create_date=#{createDate},</if>
|
||||
<if test="updateDate != null">update_date=#{updateDate},</if>
|
||||
<if test="customerId != null">customerId=#{customerId},</if>
|
||||
<if test="manufacturerId != null">manufacturerId=#{manufacturerId},</if>
|
||||
<if test="auditStatus != null">auditStatus=#{auditStatus},</if>
|
||||
<if test="auditComment != null">auditComment=#{auditComment},</if>
|
||||
|
||||
|
||||
</set>
|
||||
WHERE id=#{id}
|
||||
|
||||
</update>
|
||||
|
||||
<insert id="insertCompany" parameterType="com.glxp.sale.admin.entity.purchase.SupManufacturerEntity">
|
||||
INSERT INTO sup_manufacturer(companyName, creditCode, companyType,
|
||||
placeArea, placeAreaCode, placeAddress,
|
||||
legalPersonName, legalPersonPapersType, legalPersonPapersCode,
|
||||
productionArea, productionAreaCode, productionAddress,
|
||||
registerStatus, productionLicenceNum, productionLicenceDate,
|
||||
productionRecordNum, productionRecordSection, productionRecordDate,
|
||||
remark, create_date, update_date, customerId, manufacturerId,
|
||||
auditStatus, auditComment)
|
||||
values (#{companyName}, #{creditCode}, #{companyType},
|
||||
#{placeArea}, #{placeAreaCode}, #{placeAddress},
|
||||
#{legalPersonName}, #{legalPersonPapersType}, #{legalPersonPapersCode},
|
||||
#{productionArea}, #{productionAreaCode}, #{productionAddress},
|
||||
#{registerStatus}, #{productionLicenceNum}, #{productionLicenceDate},
|
||||
#{productionRecordNum}, #{productionRecordSection}, #{productionRecordDate},
|
||||
#{remark}, #{createDate}, #{updateDate}, #{customerId}, #{manufacturerId}, #{auditStatus},
|
||||
#{auditComment})
|
||||
</insert>
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM sup_manufacturer
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,158 @@
|
||||
<?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.purchase.SupProductDao">
|
||||
|
||||
<select id="findRegistration" parameterType="java.lang.Long"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupProductEntity">
|
||||
SELECT *
|
||||
FROM sup_product
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="findRegistrationByName" parameterType="java.lang.String"
|
||||
resultType="com.glxp.sale.admin.entity.purchase.SupProductEntity">
|
||||
SELECT *
|
||||
FROM sup_product
|
||||
where recordProductName = #{recordProductName}
|
||||
</select>
|
||||
|
||||
<select id="getRegistration" parameterType="com.glxp.sale.admin.req.purchase.FilterPoductRequest"
|
||||
resultType="com.glxp.sale.admin.res.purchase.SupProductResponse">
|
||||
SELECT sup_product.* ,sup_company.companyName
|
||||
supName,sup_manufacturer.companyName manufacturerName FROM sup_product
|
||||
inner join sup_company
|
||||
on sup_product.customerId = sup_company.customerId
|
||||
INNER JOIN sup_manufacturer
|
||||
on sup_manufacturer.manufacturerId =
|
||||
sup_product.manufacturerIdFk
|
||||
|
||||
<where>
|
||||
<if test="id != null and id != ''">
|
||||
and sup_product.id = #{id}
|
||||
</if>
|
||||
|
||||
<if test="productId != null and productId != ''">
|
||||
and sup_product.productId = #{productId}
|
||||
</if>
|
||||
<if test="enterpriseId != null and enterpriseId != ''">
|
||||
and sup_product.enterpriseId = #{enterpriseId}
|
||||
</if>
|
||||
<if test="recordCode != null and recordCode != ''">
|
||||
and sup_product.recordCode like concat('%',#{recordCode},'%')
|
||||
</if>
|
||||
<if test="recordProductName != null and recordProductName != ''">
|
||||
and sup_product.recordProductName like concat('%',#{recordProductName},'%')
|
||||
</if>
|
||||
<if test="recordPeopleName != null and recordPeopleName != ''">
|
||||
and sup_product.recordPeopleName like concat('%',#{recordPeopleName},'%')
|
||||
</if>
|
||||
<if test="manufacturerIdFk != null and manufacturerIdFk != ''">
|
||||
and sup_product.manufacturerIdFk = #{manufacturerIdFk}
|
||||
</if>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and sup_product.customerId = #{customerId}
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=22 and auditStatus !=21">
|
||||
and sup_product.auditStatus = #{auditStatus}
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==20">
|
||||
and (sup_product.auditStatus = 0 or sup_product.auditStatus=5 or
|
||||
sup_product.auditStatus=2)
|
||||
</if>
|
||||
<if test="auditStatus ==21">
|
||||
and <![CDATA[ sup_product.auditStatus <> 0 ]]>
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==22">
|
||||
and (sup_product.auditStatus = 1 or sup_product.auditStatus=4 )
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="modifyRegistration" parameterType="com.glxp.sale.admin.entity.purchase.SupProductEntity">
|
||||
|
||||
UPDATE sup_product
|
||||
<set>
|
||||
<if test="enterpriseId != null">enterpriseId=#{enterpriseId},</if>
|
||||
<if test="recordCode != null">recordCode=#{recordCode},</if>
|
||||
<if test="recordProductName != null">recordProductName=#{recordProductName},</if>
|
||||
<if test="productManageType != null">productManageType=#{productManageType},</if>
|
||||
<if test="recordPeopleName != null">recordPeopleName=#{recordPeopleName},</if>
|
||||
<if test="recordPeopleArea != null">recordPeopleArea=#{recordPeopleArea},</if>
|
||||
<if test="recordPeopleAreaCode != null">recordPeopleAreaCode=#{recordPeopleAreaCode},</if>
|
||||
<if test="recordPeopleAddress != null">recordPeopleAddress=#{recordPeopleAddress},</if>
|
||||
<if test="productType != null">productType=#{productType},</if>
|
||||
<if test="productDirectoryCode != null">productDirectoryCode=#{productDirectoryCode},</if>
|
||||
<if test="agentName != null">agentName=#{agentName},</if>
|
||||
<if test="agentArea != null">agentArea=#{agentArea},</if>
|
||||
<if test="agentAreaCode != null">agentAreaCode=#{agentAreaCode},</if>
|
||||
<if test="agentAddress != null">agentAddress=#{agentAddress},</if>
|
||||
<if test="instructions != null">instructions=#{instructions},</if>
|
||||
<if test="productAddress != null">productAddress=#{productAddress},</if>
|
||||
<if test="recordText != null">recordText=#{recordText},</if>
|
||||
<if test="placeOrigin != null">placeOrigin=#{placeOrigin},</if>
|
||||
<if test="productionRegion != null">productionRegion=#{productionRegion},</if>
|
||||
<if test="productionCompanyName != null">productionCompanyName=#{productionCompanyName},</if>
|
||||
<if test="afterSale != null">afterSale=#{afterSale},</if>
|
||||
<if test="specification != null">specification=#{specification},</if>
|
||||
<if test="structure != null">structure=#{structure},</if>
|
||||
<if test="scope != null">scope=#{scope},</if>
|
||||
<if test="other != null">other=#{other},</if>
|
||||
<if test="filePath != null">filePath=#{filePath},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
<if test="create_date != null">create_date=#{create_date},</if>
|
||||
<if test="update_date != null">update_date=#{update_date},</if>
|
||||
<if test="manufacturerIdFk != null">manufacturerIdFk=#{manufacturerIdFk},</if>
|
||||
<if test="customerId != null">customerId=#{customerId},</if>
|
||||
<if test="productId != null">productId=#{productId},</if>
|
||||
<if test="auditStatus != null">auditStatus=#{auditStatus},</if>
|
||||
<if test="auditComment != null">auditComment=#{auditComment},</if>
|
||||
<if test="sptm != null">sptm=#{sptm},</if>
|
||||
<if test="ybbm != null">ybbm=#{ybbm},</if>
|
||||
<if test="measname != null">measname=#{measname},</if>
|
||||
<if test="cpms != null">cpms=#{cpms},</if>
|
||||
</set>
|
||||
WHERE id=#{id}
|
||||
|
||||
</update>
|
||||
|
||||
<insert id="insertRegistration" parameterType="com.glxp.sale.admin.entity.purchase.SupProductEntity">
|
||||
INSERT INTO sup_product(enterpriseId, recordCode, recordProductName,
|
||||
productManageType, recordPeopleName, recordPeopleArea,
|
||||
recordPeopleAreaCode, recordPeopleAddress, productType,
|
||||
productDirectoryCode, agentName, agentArea,
|
||||
agentAreaCode, agentAddress, instructions,
|
||||
productAddress, recordText, placeOrigin,
|
||||
productionRegion, productionCompanyName, afterSale,
|
||||
specification, structure, `scope`,
|
||||
other, filePath, remark,
|
||||
create_date, update_date, manufacturerIdFk, customerId, productId
|
||||
, auditStatus, auditComment, sptm, ybbm, measname, cpms)
|
||||
values (#{enterpriseId}, #{recordCode}, #{recordProductName},
|
||||
#{productManageType}, #{recordPeopleName}, #{recordPeopleArea},
|
||||
#{recordPeopleAreaCode}, #{recordPeopleAddress}, #{productType},
|
||||
#{productDirectoryCode}, #{agentName}, #{agentArea},
|
||||
#{agentAreaCode}, #{agentAddress}, #{instructions},
|
||||
#{productAddress}, #{recordText}, #{placeOrigin},
|
||||
#{productionRegion}, #{productionCompanyName}, #{afterSale},
|
||||
#{specification}, #{structure}, #{scope},
|
||||
#{other}, #{filePath}, #{remark},
|
||||
#{create_date}, #{update_date}, #{manufacturerIdFk}, #{customerId}, #{productId}
|
||||
, #{auditStatus}, #{auditComment}, #{sptm}, #{ybbm}, #{measname}, #{cpms})
|
||||
</insert>
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM sup_product
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByEnterpriseId" parameterType="Map">
|
||||
DELETE
|
||||
FROM sup_product
|
||||
WHERE enterpriseId = #{enterpriseId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue