新增往来单位资质证书上传等

cert
anthonywj 2 years ago
parent b864f15d4e
commit 15e44b7b3d

@ -193,10 +193,11 @@ public class ConstantStatus {
public static final int CORP_TYPE_SPECIAL = 4; //特俗往来
public static final int CORP_TYPE_DEPT = 4; //部门
public static final int CORP_SICK_INN = 1;
public static final int CORP_SICK_SICK = 1;
public static final int CORP_SICK_CUS = 2;
//单据来源
public static final int FROM_UDIMS = 1; //1.UDIMS平台
public static final int FROM_WEBNEW = 2; //网页新增

@ -0,0 +1,142 @@
package com.glxp.api.controller.basic;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.basic.BasicCorpService;
import com.glxp.api.util.CustomUtil;
import org.springframework.beans.BeanUtils;
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 javax.validation.Valid;
import java.util.Date;
import java.util.List;
/**
*
*/
@RestController
public class BasicCorpController {
@Resource
private BasicCorpService basicUnitMaintainService;
@GetMapping("/udiwms/basic/unit/maintain/filter")
public BaseResponse filterBasicUnitMaintain(BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<BasicCorpEntity> basicUnitMaintainEntities;
basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest);
PageInfo<BasicCorpEntity> pageInfo = new PageInfo<>(basicUnitMaintainEntities);
PageSimpleResponse<BasicCorpEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(basicUnitMaintainEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/basic/unit/maintain/save")
public BaseResponse save(@RequestBody @Valid BasicCorpEntity basicUnitMaintainSaveRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
boolean result = basicUnitMaintainService.verifyExists(basicUnitMaintainSaveRequest);
if (result) {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "重复添加");
}
BasicCorpEntity basicUnitMaintainEntity = new BasicCorpEntity();
BeanUtils.copyProperties(basicUnitMaintainSaveRequest, basicUnitMaintainEntity);
basicUnitMaintainEntity.setErpId(CustomUtil.getId());
if (basicUnitMaintainSaveRequest.getCorpType() == 1) {
basicUnitMaintainEntity.setOutType(ConstantStatus.CORP_SICK_CUS);
} else if (basicUnitMaintainSaveRequest.getCorpType() == 2) {
basicUnitMaintainEntity.setOutType(ConstantStatus.CORP_SICK_SICK);
} else {
basicUnitMaintainEntity.setOutType(ConstantStatus.CORP_SICK_INN);
}
basicUnitMaintainEntity.setUpdateTime(new Date());
basicUnitMaintainEntity.setId(IdUtil.getSnowflakeNextId());
basicUnitMaintainEntity.setCompanyIdFk(Long.parseLong(getCompanyId()));
boolean b = basicUnitMaintainService.insert(basicUnitMaintainEntity);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
return ResultVOUtils.success();
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/basic/unit/maintain/update")
public BaseResponse update(@RequestBody @Valid BasicCorpEntity basicUnitMaintainSaveRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
boolean result = basicUnitMaintainService.verifyExists(basicUnitMaintainSaveRequest);
if (result) {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "重复添加");
}
basicUnitMaintainSaveRequest.setOutType(ConstantStatus.CORP_SICK_CUS);
basicUnitMaintainSaveRequest.setUpdateTime(new Date());
basicUnitMaintainService.updateById(basicUnitMaintainSaveRequest);
return ResultVOUtils.success("修改成功");
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/basic/unit/maintain/delete")
public BaseResponse deleteBasicUnitMaintain(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String id = deleteRequest.getId();
BasicCorpEntity basicUnitMaintainEntity = basicUnitMaintainService.selectById(id);
//todo 该功能还未设计
// //判断是否被单据绑定
// OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
// orderFilterRequest.setFromCorpId(basicUnitMaintainEntity.getErpId());
// OrderEntity orderEntity = orderService.findOne(orderFilterRequest);
// if (orderEntity != null) {
// return ResultVOUtils.error(500, "已存在该供应商单据,无法删除!");
// }
basicUnitMaintainService.deleteById(id);
return ResultVOUtils.success("删除成功");
}
public String getCompanyId() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {
throw new JsonException(ResultEnum.NOT_NETWORK);
}
HttpServletRequest request = attributes.getRequest();
String companyId = request.getHeader("companyId");
return companyId;
}
}

@ -93,6 +93,25 @@ public class SupCertController {
return ResultVOUtils.success(pageSimpleResponse);
}
//查询往来单位资质证书
@GetMapping("/sup/app/corp/cert/list")
public BaseResponse filterCorpCert(certRequest certRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (certRequest.getCompanyIdFk() == null) {
return ResultVOUtils.error(500, "企业ID不能为空");
}
certRequest.setType(4);
List<SupCertEntity> supCertEntities = supCertService.selectBybId(certRequest);
PageInfo<SupCertEntity> pageInfo;
pageInfo = new PageInfo<>(supCertEntities);
PageSimpleResponse<SupCertEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(supCertEntities);
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@GetMapping("/sup/company/cert/filter")

@ -17,7 +17,7 @@ public interface BasicCorpDao extends BaseMapperPlus<BasicCorpDao, BasicCorpEnti
boolean insertBasicUnitMaintain(BasicCorpEntity basicUnitMaintainEntity);
boolean insertThrUnitMaintainignore(ThrUnitMaintainResponse thrUnitMaintainResponse);
boolean insertThrUnitMaintainignore(BasicCorpEntity thrUnitMaintainResponse);
int insertEntity(BasicCorpEntity basicUnitMaintainEntity);

@ -140,5 +140,8 @@ public class BasicCorpEntity {
@TableField(value = "remark")
private String remark;
@TableField(value = "companyIdFk")
private Long companyIdFk;
}

@ -129,6 +129,7 @@ public class SupCertEntity {
@TableField("updateTime")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date updateTime;
@TableField("companyIdFk")
private Long companyIdFk;
}

@ -125,6 +125,9 @@ public class certRequest extends ListPageRequest {
private Integer type;
private String mobile;
@ApiModelProperty(value = "企业ID")
private Long companyIdFk;
private String lastUpdateTime;
private static final long serialVersionUID = 1L;
}

@ -33,7 +33,7 @@ public interface BasicCorpService extends IService<BasicCorpEntity> {
boolean isExit();
// boolean insertThrUnitMaintainignore(ThrUnitMaintainResponse thrUnitMaintainResponse);
boolean insertThrUnitMaintainignore(BasicCorpEntity thrUnitMaintainResponse);
List<BasicCorpEntity> batchSelectByIds(List<Integer> id);

@ -38,11 +38,11 @@ public class BasicCorpServiceImpl extends ServiceImpl<BasicCorpDao, BasicCorpEnt
return data;
}
// @Override
// public boolean insertThrUnitMaintainignore(ThrUnitMaintainResponse thrUnitMaintainResponse) {
// thrUnitMaintainResponse.setUpdateTime(new Date());
// return basicCorpDao.insertThrUnitMaintainignore(thrUnitMaintainResponse);
// }
@Override
public boolean insertThrUnitMaintainignore(BasicCorpEntity thrUnitMaintainResponse) {
thrUnitMaintainResponse.setUpdateTime(new Date());
return basicCorpDao.insertThrUnitMaintainignore(thrUnitMaintainResponse);
}
@Override
public boolean insertBasicUnitMaintain(BasicCorpEntity basicUnitMaintainEntity) {

@ -2,24 +2,24 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.dao.basic.BasicCorpDao">
<select id="filterList" parameterType="com.glxp.api.req.basic.BasicUnitMaintainFilterRequest"
resultType="com.glxp.api.entity.basic.BasicCorpEntity">
SELECT * FROM basic_corp
SELECT *
FROM basic_corp
<where>
<if test="key != '' and key!=null">
<if test="key != '' and key != null">
and
( name like concat('%',#{key},'%')
or spell like concat('%',#{key},'%')
or erpId like concat('%',#{key},'%')
or creditNo like concat('%',#{key},'%')
or thirdId like concat('%',#{key},'%')
or thirdId1 like concat('%',#{key},'%')
or thirdId2 like concat('%',#{key},'%')
or thirdId3 like concat('%',#{key},'%')
or thirdId4 like concat('%',#{key},'%')
or addr like concat('%',#{key},'%')
)
(name like concat('%', #{key}, '%')
or spell like concat('%', #{key}, '%')
or erpId like concat('%', #{key}, '%')
or creditNo like concat('%', #{key}, '%')
or thirdId like concat('%', #{key}, '%')
or thirdId1 like concat('%', #{key}, '%')
or thirdId2 like concat('%', #{key}, '%')
or thirdId3 like concat('%', #{key}, '%')
or thirdId4 like concat('%', #{key}, '%')
or addr like concat('%', #{key}, '%')
)
</if>
<if test="id != '' and id != null">
AND id = #{id}
@ -34,23 +34,24 @@
AND corpType = #{corpType}
</if>
<if test="outType != null">
AND ( outType <![CDATA[ <> ]]> #{outType} or outType is NULL)
AND (outType <![CDATA[ <> ]]> #{outType} or outType is NULL)
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="name != '' and name != null">
AND name = #{name}
</if>
</where>
order by updateTime desc
</select>
<select id="selectByThirdId" parameterType="com.glxp.api.req.basic.BasicUnitMaintainFilterRequest"
resultType="com.glxp.api.entity.basic.BasicCorpEntity">
select * FROM basic_corp
select *
FROM basic_corp
<where>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
@ -77,84 +78,81 @@
<insert id="insertBasicUnitMaintain"
parameterType="com.glxp.api.entity.basic.BasicCorpEntity">
REPLACE
INTO basic_corp
(thirdId,erpId,name,spell,
addr,status,type,creditNo,contact,mobile,thirdId1,thirdId2,thirdId3,thirdId4,
thirdName,thirdName1,thirdName2,thirdName3,thirdName4,updateTime,corpType,outType,createUser,createTime,updateUser,remark)
values
(
#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType},
#{createUser},
#{createTime},
#{updateUser},
#{remark}
)
INTO basic_corp
(thirdId, erpId, name, spell,
addr, status, type, creditNo, contact, mobile, thirdId1, thirdId2, thirdId3, thirdId4,
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType, outType, createUser,
createTime, updateUser, remark)
values (#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType},
#{createUser},
#{createTime},
#{updateUser},
#{remark})
</insert>
<insert id="insertThrUnitMaintainignore" keyProperty="id"
parameterType="com.glxp.api.res.thrsys.ThrUnitMaintainResponse">
parameterType="com.glxp.api.entity.basic.BasicCorpEntity">
insert
ignore
ignore
INTO basic_corp
(thirdId,erpId,name,spell,
addr,status,type,creditNo,contact,mobile,thirdId1,thirdId2,thirdId3,thirdId4,
thirdName,thirdName1,thirdName2,thirdName3,thirdName4,updateTime,corpType,outType,createUser,createTime,updateUser,remark)
values
(
#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType},
#{createUser},
#{createTime},
#{updateUser},
#{remark}
)
(thirdId, erpId, name, spell,
addr, status, type, creditNo, contact, mobile, thirdId1, thirdId2, thirdId3, thirdId4,
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType, outType, createUser,
createTime, updateUser, remark)
values (#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType},
#{createUser},
#{createTime},
#{updateUser},
#{remark})
</insert>
<insert id="insertEntity" parameterType="com.glxp.api.entity.basic.BasicCorpEntity">
insert INTO basic_corp(thirdId, erpId, name, spell, addr,
status, type, creditNo, contact, mobile, thirdId1, thirdId2, thirdId3, thirdId4,
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType, outType,createUser,createTime,updateUser,remark)
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType, outType,
createUser, createTime, updateUser, remark)
values (#{thirdId},
#{erpId},
#{name},
@ -167,7 +165,7 @@
#{mobile},
#{thirdId1}, #{thirdId2}, #{thirdId3}, #{thirdId4},
#{thirdName}, #{thirdName1}, #{thirdName2}, #{thirdName3}, #{thirdName4}, #{updateTime}, #{corpType},
#{outType},#{createUser},
#{outType}, #{createUser},
#{createTime},
#{updateUser},
#{remark})
@ -177,34 +175,86 @@
<update id="updateEntityById" parameterType="com.glxp.api.entity.basic.BasicCorpEntity">
UPDATE basic_corp
<trim prefix="set" suffixOverrides=",">
<if test="thirdId != null">thirdId=#{thirdId},</if>
<if test="erpId != null">erpId=#{erpId},</if>
<if test="name != null">name=#{name},</if>
<if test="spell != null">spell=#{spell},</if>
<if test="addr != null">addr=#{addr},</if>
<if test="status != null">status=#{status},</if>
<if test="type != null">type=#{type},</if>
<if test="creditNo != null">creditNo=#{creditNo},</if>
<if test="contact != null">contact=#{contact},</if>
<if test="mobile != null">mobile=#{mobile},</if>
<if test="thirdId1 != null">thirdId1=#{thirdId1},</if>
<if test="thirdId2 != null">thirdId2=#{thirdId2},</if>
<if test="thirdId3 != null">thirdId3=#{thirdId3},</if>
<if test="thirdId4 != null">thirdId4=#{thirdId4},</if>
<if test="thirdName != null">thirdName=#{thirdName},</if>
<if test="thirdName1 != null">thirdName1=#{thirdName1},</if>
<if test="thirdName2 != null">thirdName2=#{thirdName2},</if>
<if test="thirdName3 != null">thirdName3=#{thirdName3},</if>
<if test="thirdName4 != null">thirdName4=#{thirdName4},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="corpType != null">corpType=#{corpType},</if>
<if test="outType != null">outType=#{outType},</if>
<if test="createUser != null">createUser=#{createUser},</if>
<if test="createTime != null">createTime=#{createTime},</if>
<if test="updateUser != null">updateUser=#{updateUser},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="thirdId != null">
thirdId=#{thirdId},
</if>
<if test="erpId != null">
erpId=#{erpId},
</if>
<if test="name != null">
name=#{name},
</if>
<if test="spell != null">
spell=#{spell},
</if>
<if test="addr != null">
addr=#{addr},
</if>
<if test="status != null">
status=#{status},
</if>
<if test="type != null">
type=#{type},
</if>
<if test="creditNo != null">
creditNo=#{creditNo},
</if>
<if test="contact != null">
contact=#{contact},
</if>
<if test="mobile != null">
mobile=#{mobile},
</if>
<if test="thirdId1 != null">
thirdId1=#{thirdId1},
</if>
<if test="thirdId2 != null">
thirdId2=#{thirdId2},
</if>
<if test="thirdId3 != null">
thirdId3=#{thirdId3},
</if>
<if test="thirdId4 != null">
thirdId4=#{thirdId4},
</if>
<if test="thirdName != null">
thirdName=#{thirdName},
</if>
<if test="thirdName1 != null">
thirdName1=#{thirdName1},
</if>
<if test="thirdName2 != null">
thirdName2=#{thirdName2},
</if>
<if test="thirdName3 != null">
thirdName3=#{thirdName3},
</if>
<if test="thirdName4 != null">
thirdName4=#{thirdName4},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
<if test="corpType != null">
corpType=#{corpType},
</if>
<if test="outType != null">
outType=#{outType},
</if>
<if test="createUser != null">
createUser=#{createUser},
</if>
<if test="createTime != null">
createTime=#{createTime},
</if>
<if test="updateUser != null">
updateUser=#{updateUser},
</if>
<if test="remark != null">
remark=#{remark},
</if>
</trim>
WHERE id=#{id}
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">
@ -241,43 +291,43 @@
resultType="com.glxp.api.entity.basic.BasicCorpEntity">
SELECT *
FROM basic_corp
WHERE (name = #{name}) limit 1
WHERE (name = #{name})
limit 1
</select>
<insert id="importBasicUnitMaintain" >
<insert id="importBasicUnitMaintain">
REPLACE
INTO basic_corp
( thirdId, erpId, `name`, spell,
INTO basic_corp
(thirdId, erpId, `name`, spell,
addr, status, `type`, creditNo, contact, mobile, thirdId1, thirdId2, thirdId3, thirdId4,
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType,outType,createUser,createTime,updateUser,remark)
values (
#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType},
#{createUser},
#{createTime},
#{updateUser},
#{remark}
)
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType, outType, createUser,
createTime, updateUser, remark)
values (#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType},
#{createUser},
#{createTime},
#{updateUser},
#{remark})
</insert>
<select id="batchSelectByErpIdsAndName" resultType="com.glxp.api.entity.basic.BasicCorpEntity">
@ -288,7 +338,7 @@
AND name like concat('%', #{name}, '%')
</if>
<if test="erpIds != null and erpIds.size() != 0">
AND erpId in
AND erpId in
<foreach collection="erpIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
@ -297,7 +347,8 @@
</select>
<select id="selectByNameAndCreditNo" resultType="com.glxp.api.entity.basic.BasicCorpEntity">
select * from basic_corp
select *
from basic_corp
<where>
<if test="name != null and name != ''">
AND name = #{name}
@ -309,10 +360,14 @@
</select>
<select id="selectByErpId" resultType="com.glxp.api.entity.basic.BasicCorpEntity">
select * from basic_corp where erpId = #{erpId}
select *
from basic_corp
where erpId = #{erpId}
</select>
<select id="selectNameByErpId" resultType="java.lang.String">
select name from basic_corp where erpId = #{supId}
select name
from basic_corp
where erpId = #{supId}
</select>
</mapper>

@ -4,68 +4,72 @@
<mapper namespace="com.glxp.api.dao.purchase.SupCertDao">
<select id="filterCert" parameterType="com.glxp.api.req.purchase.FilterSupCertRequest"
resultType="com.glxp.api.entity.purchase.SupCertEntity">
select * from sup_cert
select *
from sup_cert
<where>
<if test="businessId != '' and businessId!=null">
<if test="businessId != '' and businessId != null">
and businessId = #{businessId}
</if>
<if test="customerId != '' and customerId!=null">
<if test="companyIdFk != null">
and companyIdFk = #{companyIdFk}
</if>
<if test="customerId != '' and customerId != null">
and customerId = #{customerId}
</if>
<if test="manufacturerIdFk != '' and manufacturerIdFk!=null">
<if test="manufacturerIdFk != '' and manufacturerIdFk != null">
and manufacturerIdFk = #{manufacturerIdFk}
</if>
<if test="productIdFk != '' and productIdFk!=null">
<if test="productIdFk != '' and productIdFk != null">
and productIdFk = #{productIdFk}
</if>
<if test="type != '' and type!=null">
<if test="type != '' and type != null">
and `type` = #{type}
</if>
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=24 and auditStatus !=25" >
<if test="auditStatus != null and auditStatus != 20 and auditStatus != 24 and auditStatus != 25">
and auditStatus = #{auditStatus}
</if>
<if test="auditStatus ==20">
and (auditStatus = 1 or auditStatus=4)
<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 test="auditStatus == 24">
and (auditStatus = 2 or auditStatus = 3 or auditStatus = 5 or auditStatus = 6)
</if>
<if test="auditStatus ==25">
and (auditStatus !=0)
<if test="auditStatus == 25">
and (auditStatus != 0)
</if>
</where>
ORDER BY id DESC
</select>
<select id="filterCompanyCert" parameterType="com.glxp.api.req.purchase.FilterSupCertRequest"
resultType="com.glxp.api.entity.purchase.SupCertEntity">
select * from sup_cert
select *
from sup_cert
<where>
<if test="customerId != '' and customerId!=null">
<if test="customerId != '' and customerId != null">
and customerId = #{customerId}
</if>
<if test="manufacturerIdFk != '' and manufacturerIdFk!=null">
<if test="manufacturerIdFk != '' and manufacturerIdFk != null">
and manufacturerIdFk = #{manufacturerIdFk}
</if>
<if test="productIdFk != '' and productIdFk!=null">
<if test="productIdFk != '' and productIdFk != null">
and productIdFk = #{productIdFk}
</if>
<if test="type != '' and type!=null">
<if test="type != '' and type != null">
and `type` = #{type}
</if>
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=24 and auditStatus !=25" >
<if test="auditStatus != null and auditStatus != 20 and auditStatus != 24 and auditStatus != 25">
and auditStatus = #{auditStatus}
</if>
<if test="auditStatus ==20">
and (auditStatus = 1 or auditStatus=4)
<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 test="auditStatus == 24">
and (auditStatus = 2 or auditStatus = 3 or auditStatus = 5 or auditStatus = 6)
</if>
<if test="auditStatus ==25">
and (auditStatus !=0)
<if test="auditStatus == 25">
and (auditStatus != 0)
</if>
<if test="businessId != '' and businessId!=null">
<if test="businessId != '' and businessId != null">
and businessId = #{businessId}
</if>
</where>
@ -74,19 +78,20 @@
<select id="filterUserCompanyCert" parameterType="com.glxp.api.req.purchase.FilterSupCertRequest"
resultType="com.glxp.api.entity.purchase.SupCertEntity">
select * from sup_cert
select *
from sup_cert
<where>
<if test="businessId != '' and businessId!=null">
<if test="businessId != '' and businessId != null">
and businessId = #{businessId}
</if>
</where>
ORDER BY id DESC
</select>
<select id="selectCompanyCert" parameterType="com.glxp.api.req.purchase.FilterSupCertRequest"
resultType="com.glxp.api.entity.purchase.SupCertEntity">
SELECT * FROM sup_cert
SELECT *
FROM sup_cert
<where>
<if test="customerId != null and customerId != ''">
and customerId = #{customerId}
@ -95,7 +100,6 @@
and #{name}
</if>
</where>
</select>
@ -108,13 +112,14 @@
<select id="getCompanyCert" parameterType="com.glxp.api.req.purchase.FilterSupCertRequest"
resultType="com.glxp.api.entity.purchase.SupCertEntity">
SELECT * FROM sup_cert
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},'%')
and name like concat('%', #{name}, '%')
</if>
<if test="manufacturerIdFk != null and manufacturerIdFk != ''">
and manufacturerIdFk = #{manufacturerIdFk}
@ -126,40 +131,63 @@
and type = #{type}
</if>
</where>
</select>
<update id="updateCompanyCert" parameterType="com.glxp.api.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="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>
vailDate=#{vailDate},
expireDate=#{expireDate},
<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>
<if test="status != null">`status`=#{status},</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>
<if test="status != null">
`status`=#{status},
</if>
</trim>
WHERE id = #{id}
</update>
<update id="updateCustomerId" parameterType="Map">
UPDATE sup_cert
set customerId = #{newId}
<if test="auditStatus != '' and auditStatus!=null">
,auditStatus = #{auditStatus}
set customerId = #{newId}
<if test="auditStatus != '' and auditStatus != null">
, auditStatus = #{auditStatus}
</if>
WHERE customerId = #{oldId}
</update>
@ -209,26 +237,26 @@
DELETE
FROM sup_cert
<where>
<if test="customerId != '' and customerId!=null">
<if test="customerId != '' and customerId != null">
and customerId = #{customerId}
</if>
<if test="manufacturerIdFk != '' and manufacturerIdFk!=null">
<if test="manufacturerIdFk != '' and manufacturerIdFk != null">
and manufacturerIdFk = #{manufacturerIdFk}
</if>
<if test="productIdFk != '' and productIdFk!=null">
<if test="productIdFk != '' and productIdFk != null">
and productIdFk = #{productIdFk}
</if>
</where>
</delete>
<select id="selectSupCertList" parameterType="com.glxp.api.req.purchase.purPlanPrintRequest"
resultType="com.glxp.api.entity.purchase.SupCertEntity">
select * from sup_cert
select *
from sup_cert
<where>
<if test="ids != null and ids.size()>0">
AND id in
<if test="ids != null and ids.size() > 0">
AND id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
@ -236,5 +264,4 @@
</where>
ORDER BY id DESC
</select>
</mapper>

@ -16,7 +16,7 @@ CALL Pro_Temp_ColumnWork('trace_order', 'invCount', 'int', 1);
CALL Pro_Temp_ColumnWork('trace_product_record', 'companyIdFk', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('sup_cert', 'companyIdFk', 'bigInt', 1);

Loading…
Cancel
Save