Merge remote-tracking branch 'origin/zmlDev' into test
commit
45fb45d43c
@ -0,0 +1,17 @@
|
|||||||
|
package com.glxp.api.dao.basic;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.glxp.api.entity.basic.BasicProductCategory;
|
||||||
|
import com.glxp.api.res.basic.BasicProductCategoryTypeResponse;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface BasicProductCategoryMapper extends BaseMapper<BasicProductCategory> {
|
||||||
|
List<BasicProductCategoryTypeResponse> getTreeList();
|
||||||
|
List<BasicProductCategory> selectLowTypeAll(@Param("code") String code);
|
||||||
|
|
||||||
|
Long selectProductByRelCode(@Param("relCode") String relCode);
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.glxp.api.dao.basic;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.glxp.api.entity.basic.BasicProductCategoryRel;
|
||||||
|
import com.glxp.api.req.basic.FilterUdiProductRequest;
|
||||||
|
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface BasicProductCategoryRelMapper extends BaseMapper<BasicProductCategoryRel> {
|
||||||
|
|
||||||
|
List<UdiRelevanceResponse> selectAll(FilterUdiProductRequest filterUdiProductRequest);
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.glxp.api.entity.basic;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物资类别表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName(value = "basic_product_category")
|
||||||
|
public class BasicProductCategory {
|
||||||
|
@TableId(value = "id", type = IdType.INPUT)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物资类别编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "code")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父级编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "parentCode")
|
||||||
|
private String parentCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物资类别名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "`name`")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField(value = "remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "createTime")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "updateTime")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@TableField(value = "`createUser`")
|
||||||
|
private String createUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
@TableField(value = "updateUser")
|
||||||
|
private String updateUser;
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.glxp.api.entity.basic;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName(value = "basic_product_category_rel")
|
||||||
|
public class BasicProductCategoryRel {
|
||||||
|
@TableId(value = "id", type = IdType.INPUT)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 院内编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "code")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 耗材字典ID主键
|
||||||
|
*/
|
||||||
|
@TableField(value = "relId")
|
||||||
|
private String relId;
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.glxp.api.req.basic;
|
||||||
|
|
||||||
|
import com.glxp.api.util.page.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BasicProductTypeFilterRequest extends ListPageRequest {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private Integer type;
|
||||||
|
private String code;
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.glxp.api.req.basic;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BasicProductTypeRequest {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String code;
|
||||||
|
private String parentCode;
|
||||||
|
private String name;
|
||||||
|
private String remark;
|
||||||
|
List<String> ids;
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.glxp.api.req.basic;
|
||||||
|
|
||||||
|
import com.glxp.api.util.page.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FilterUdiProductRequest extends ListPageRequest {
|
||||||
|
|
||||||
|
private String ylqxzcrbarmc;
|
||||||
|
private String cpmctymc;
|
||||||
|
private String ggxh;
|
||||||
|
private String udiCode;
|
||||||
|
private String unionCode;
|
||||||
|
private String zczbhhzbapzbh;
|
||||||
|
private String manufactory;
|
||||||
|
private String code;
|
||||||
|
private String parentCode;
|
||||||
|
private String nameCode;
|
||||||
|
private String thrPiId;
|
||||||
|
private String originUuid;
|
||||||
|
private Integer diType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.glxp.api.res.basic;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BasicProductCategoryTypeResponse {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String code;
|
||||||
|
private String parentCode;
|
||||||
|
private String name;
|
||||||
|
private String remark;
|
||||||
|
private Date createTime;
|
||||||
|
private Date updateTime;
|
||||||
|
private String createUser;
|
||||||
|
private String updateUser;
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.glxp.api.service.basic;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.glxp.api.dao.basic.BasicProductCategoryRelMapper;
|
||||||
|
import com.glxp.api.entity.basic.BasicProductCategoryRel;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BasicProductCategoryRelService extends ServiceImpl<BasicProductCategoryRelMapper, BasicProductCategoryRel> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,191 @@
|
|||||||
|
package com.glxp.api.service.basic;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.glxp.api.dao.basic.BasicProductCategoryMapper;
|
||||||
|
import com.glxp.api.dao.basic.BasicProductCategoryRelMapper;
|
||||||
|
import com.glxp.api.entity.basic.BasicProductCategory;
|
||||||
|
import com.glxp.api.entity.basic.BasicProductCategoryRel;
|
||||||
|
import com.glxp.api.req.basic.BasicProductTypeFilterRequest;
|
||||||
|
import com.glxp.api.req.basic.BasicProductTypeRequest;
|
||||||
|
import com.glxp.api.req.basic.FilterUdiProductRequest;
|
||||||
|
import com.glxp.api.res.basic.BasicProductCategoryTypeResponse;
|
||||||
|
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
||||||
|
import com.glxp.api.service.auth.CustomerService;
|
||||||
|
import com.glxp.api.service.basic.impl.BasicProductCategoryService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BasicProductCategoryServiceImpl implements BasicProductCategoryService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BasicProductCategoryMapper basicProductCategoryMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
CustomerService customerService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
BasicProductCategoryRelMapper basicProductCategoryRelMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BasicProductCategoryTypeResponse> getTreeList() {
|
||||||
|
|
||||||
|
return basicProductCategoryMapper.getTreeList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BasicProductCategory selectBasicHospTypeEntity() {
|
||||||
|
QueryWrapper<BasicProductCategory> Wrapper = new QueryWrapper<>();
|
||||||
|
Wrapper.eq("code",10000);
|
||||||
|
return basicProductCategoryMapper.selectOne(Wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BasicProductCategory> getMenuList(BasicProductTypeFilterRequest basicProductTypeFilterRequest) {
|
||||||
|
QueryWrapper<BasicProductCategory> ew=new QueryWrapper<>();
|
||||||
|
ew.ne("code",10000);
|
||||||
|
if(basicProductTypeFilterRequest.getType()!=null && basicProductTypeFilterRequest.getType()==1 && StrUtil.isNotEmpty(basicProductTypeFilterRequest.getCode())){
|
||||||
|
List<BasicProductCategory> basicProductCategories = basicProductCategoryMapper.selectLowTypeAll(basicProductTypeFilterRequest.getCode());
|
||||||
|
List<Long> ids = basicProductCategories.stream().map(BasicProductCategory::getId).collect(Collectors.toList());
|
||||||
|
ew.notIn("id",ids);
|
||||||
|
}
|
||||||
|
List<BasicProductCategory> list = basicProductCategoryMapper.selectList(ew);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean checkName(BasicProductTypeRequest basicProductTypeRequest, Integer type) {
|
||||||
|
Long sum=null;
|
||||||
|
//1添加
|
||||||
|
if(type==1){
|
||||||
|
//查看名字是不是重复
|
||||||
|
QueryWrapper<BasicProductCategory> ew=new QueryWrapper<>();
|
||||||
|
ew.eq("name",basicProductTypeRequest.getName());
|
||||||
|
sum=basicProductCategoryMapper.selectCount(ew);
|
||||||
|
}else{
|
||||||
|
QueryWrapper<BasicProductCategory> ew=new QueryWrapper<>();
|
||||||
|
ew.eq("name",basicProductTypeRequest.getName());
|
||||||
|
ew.ne("id",basicProductTypeRequest.getId());
|
||||||
|
sum=basicProductCategoryMapper.selectCount(ew);
|
||||||
|
}
|
||||||
|
if(sum>0){
|
||||||
|
return false;
|
||||||
|
}else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateBasicHospType(BasicProductTypeRequest basicProductTypeRequest) {
|
||||||
|
boolean falg=true;
|
||||||
|
BasicProductCategory basicProductCategory = new BasicProductCategory();
|
||||||
|
basicProductCategory.setId(basicProductTypeRequest.getId());
|
||||||
|
basicProductCategory.setCreateTime(new Date());
|
||||||
|
basicProductCategory.setUpdateTime(new Date());
|
||||||
|
basicProductCategory.setName(basicProductTypeRequest.getName());
|
||||||
|
basicProductCategory.setParentCode(basicProductTypeRequest.getParentCode());
|
||||||
|
basicProductCategory.setRemark(basicProductTypeRequest.getRemark());
|
||||||
|
Long userId=customerService.getUserId();
|
||||||
|
basicProductCategory.setCreateUser(userId+"");
|
||||||
|
basicProductCategory.setUpdateUser(userId+"");
|
||||||
|
int i = basicProductCategoryMapper.updateById(basicProductCategory);
|
||||||
|
if(i == 0){
|
||||||
|
falg=false;
|
||||||
|
}
|
||||||
|
return falg;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean saveBasicHospType(BasicProductTypeRequest basicProductTypeRequest) {
|
||||||
|
boolean falg=true;
|
||||||
|
BasicProductCategory basicProductCategory = new BasicProductCategory();
|
||||||
|
basicProductCategory.setId(basicProductTypeRequest.getId());
|
||||||
|
basicProductCategory.setCreateTime(new Date());
|
||||||
|
basicProductCategory.setUpdateTime(new Date());
|
||||||
|
basicProductCategory.setName(basicProductTypeRequest.getName());
|
||||||
|
basicProductCategory.setParentCode(basicProductTypeRequest.getParentCode());
|
||||||
|
basicProductCategory.setRemark(basicProductTypeRequest.getRemark());
|
||||||
|
Long userId=customerService.getUserId();
|
||||||
|
basicProductCategory.setCreateUser(userId+"");
|
||||||
|
basicProductCategory.setUpdateUser(userId+"");
|
||||||
|
//获取数据库最大的code
|
||||||
|
QueryWrapper<BasicProductCategory> ew=new QueryWrapper<>();
|
||||||
|
ew.select("max(code) as code");
|
||||||
|
BasicProductCategory basicProductCategory1 = basicProductCategoryMapper.selectOne(ew);
|
||||||
|
basicProductCategory.setCode(Integer.valueOf(basicProductCategory1.getCode())+1+"");
|
||||||
|
basicProductCategory.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
int insert = basicProductCategoryMapper.insert(basicProductCategory);
|
||||||
|
if(insert == 0){
|
||||||
|
falg=false;
|
||||||
|
}
|
||||||
|
return falg;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String delectBasicHospType(BasicProductTypeRequest basicProductTypeRequest) {
|
||||||
|
//查询是否有自己的子集
|
||||||
|
QueryWrapper<BasicProductCategory> ew=new QueryWrapper<>();
|
||||||
|
ew.eq("parentCode",basicProductTypeRequest.getCode());
|
||||||
|
Long count=basicProductCategoryMapper.selectCount(ew);
|
||||||
|
if(count>0){
|
||||||
|
return "请先删除该节点底下的数据!";
|
||||||
|
}
|
||||||
|
//查询是否有绑定产品
|
||||||
|
count = basicProductCategoryMapper.selectProductByRelCode(basicProductTypeRequest.getCode());
|
||||||
|
if(count >0){
|
||||||
|
return "该节点还存在产品,请先删除!";
|
||||||
|
}
|
||||||
|
basicProductCategoryMapper.deleteById(basicProductTypeRequest.getId());
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UdiRelevanceResponse> selectAll(FilterUdiProductRequest filterUdiProductRequest) {
|
||||||
|
if (filterUdiProductRequest == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
if (filterUdiProductRequest.getPage() != null) {
|
||||||
|
int offset = (filterUdiProductRequest.getPage() - 1) * filterUdiProductRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, filterUdiProductRequest.getLimit());
|
||||||
|
}
|
||||||
|
|
||||||
|
return basicProductCategoryRelMapper.selectAll(filterUdiProductRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean insertCateRel(BasicProductTypeRequest basicProductTypeRequest) {
|
||||||
|
BasicProductCategoryRel basicProductCategoryRel = new BasicProductCategoryRel();
|
||||||
|
int insert =0;
|
||||||
|
for (String id : basicProductTypeRequest.getIds()) {
|
||||||
|
basicProductCategoryRel.setRelId(id);
|
||||||
|
basicProductCategoryRel.setCode(basicProductTypeRequest.getCode());
|
||||||
|
insert = basicProductCategoryRelMapper.insert(basicProductCategoryRel);
|
||||||
|
}
|
||||||
|
|
||||||
|
return insert>0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BasicProductCategory checkCode(String parentCode) {
|
||||||
|
return basicProductCategoryMapper.selectOne(new QueryWrapper<BasicProductCategory>().eq("code",parentCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean deleterelByid(Integer id) {
|
||||||
|
|
||||||
|
return basicProductCategoryRelMapper.deleteById(id)>0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.glxp.api.service.basic.impl;
|
||||||
|
|
||||||
|
import com.glxp.api.entity.basic.BasicProductCategory;
|
||||||
|
import com.glxp.api.req.basic.BasicProductTypeFilterRequest;
|
||||||
|
import com.glxp.api.req.basic.BasicProductTypeRequest;
|
||||||
|
import com.glxp.api.req.basic.FilterUdiProductRequest;
|
||||||
|
import com.glxp.api.res.basic.BasicProductCategoryTypeResponse;
|
||||||
|
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface BasicProductCategoryService {
|
||||||
|
|
||||||
|
List<BasicProductCategoryTypeResponse> getTreeList();
|
||||||
|
|
||||||
|
BasicProductCategory selectBasicHospTypeEntity();
|
||||||
|
|
||||||
|
List<BasicProductCategory> getMenuList(BasicProductTypeFilterRequest basicProductTypeFilterRequest);
|
||||||
|
|
||||||
|
Boolean checkName(BasicProductTypeRequest basicProductTypeRequest, Integer type);
|
||||||
|
|
||||||
|
boolean updateBasicHospType(BasicProductTypeRequest basicProductTypeRequest);
|
||||||
|
|
||||||
|
Boolean saveBasicHospType(BasicProductTypeRequest basicProductTypeRequest);
|
||||||
|
|
||||||
|
String delectBasicHospType(BasicProductTypeRequest basicProductTypeRequest);
|
||||||
|
|
||||||
|
|
||||||
|
List<UdiRelevanceResponse> selectAll(FilterUdiProductRequest filterUdiProductRequest);
|
||||||
|
|
||||||
|
boolean insertCateRel(BasicProductTypeRequest basicProductTypeRequest);
|
||||||
|
|
||||||
|
BasicProductCategory checkCode(String parentCode);
|
||||||
|
|
||||||
|
boolean deleterelByid(Integer id);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.glxp.api.dao.basic.BasicProductCategoryMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.BasicProductCategory">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table wms_cs.basic_product_category-->
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="code" jdbcType="VARCHAR" property="code" />
|
||||||
|
<result column="parentCode" jdbcType="VARCHAR" property="parentCode" />
|
||||||
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
|
||||||
|
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, code, parentCode, `name`, remark, createTime, updateTime, `createUser`, updateUser
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="getTreeList" resultType="com.glxp.api.res.basic.BasicProductCategoryTypeResponse">
|
||||||
|
SELECT id, code, name as label, parentCode
|
||||||
|
FROM basic_product_category
|
||||||
|
ORDER BY id DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectLowTypeAll" parameterType="java.lang.String" resultType="com.glxp.api.entity.basic.BasicProductCategory">
|
||||||
|
WITH recursive table_a AS (
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
basic_product_category ta
|
||||||
|
WHERE
|
||||||
|
code = #{code}
|
||||||
|
UNION ALL
|
||||||
|
SELECT
|
||||||
|
tb.*
|
||||||
|
FROM
|
||||||
|
basic_product_category tb
|
||||||
|
INNER JOIN table_a ON table_a.CODE = tb.parentCode
|
||||||
|
) SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
table_a
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectProductByRelCode" resultType="Long">
|
||||||
|
select count(*)
|
||||||
|
from basic_udirel
|
||||||
|
where basic_udirel.relCode = #{relCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,78 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.glxp.api.dao.basic.BasicProductCategoryRelMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.BasicProductCategoryRel">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table wms_cs.basic_product_category_rel-->
|
||||||
|
<id column="id" jdbcType="INTEGER" property="id" />
|
||||||
|
<result column="code" jdbcType="VARCHAR" property="code" />
|
||||||
|
<result column="relId" jdbcType="VARCHAR" property="relId" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, code, relId
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectAll" parameterType="com.glxp.api.req.basic.FilterUdiProductRequest"
|
||||||
|
resultType="com.glxp.api.res.basic.UdiRelevanceResponse">
|
||||||
|
SELECT
|
||||||
|
basic_products.nameCode,
|
||||||
|
basic_products.cpmctymc,
|
||||||
|
basic_products.ggxh,
|
||||||
|
basic_products.zczbhhzbapzbh,
|
||||||
|
basic_products.ylqxzcrbarmc,
|
||||||
|
basic_products.manufactory,
|
||||||
|
basic_products.qxlb,
|
||||||
|
basic_udirel.id,
|
||||||
|
basic_product_category_rel.id as bpcrid
|
||||||
|
FROM basic_product_category_rel
|
||||||
|
INNER JOIN basic_udirel ON basic_product_category_rel.relId=basic_udirel.id
|
||||||
|
INNER JOIN basic_products on basic_udirel.uuid=basic_products.uuid
|
||||||
|
|
||||||
|
<where>
|
||||||
|
<if test="thrPiId != '' and thrPiId != null">
|
||||||
|
and (basic_udirel.thirdId LIKE concat('%', #{thrPiId}, '%')
|
||||||
|
or basic_udirel.thirdId1 LIKE concat('%', #{thrPiId}, '%')
|
||||||
|
or basic_udirel.thirdId2 LIKE concat('%', #{thrPiId}, '%')
|
||||||
|
or basic_udirel.thirdId3 LIKE concat('%', #{thrPiId}, '%')
|
||||||
|
or basic_udirel.thirdId4 LIKE concat('%', #{thrPiId}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="code != '' and code != null">
|
||||||
|
AND basic_product_category_rel.code= #{code}
|
||||||
|
</if>
|
||||||
|
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
|
||||||
|
AND basic_products.ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="unionCode != '' and unionCode != null">
|
||||||
|
and (
|
||||||
|
basic_products.nameCode LIKE concat('%', #{unionCode}, '%')
|
||||||
|
or basic_products.ybbm LIKE concat('%', #{unionCode}, '%')
|
||||||
|
or basic_products.sptm LIKE concat('%', #{unionCode}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="nameCode != '' and nameCode != null">
|
||||||
|
AND basic_products.nameCode LIKE concat(#{nameCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="cpmctymc != '' and cpmctymc != null">
|
||||||
|
AND basic_products.cpmctymc LIKE concat('%', #{cpmctymc}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="ggxh != '' and ggxh != null">
|
||||||
|
AND basic_products.ggxh LIKE concat('%', #{ggxh}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="manufactory != null and manufactory != ''">
|
||||||
|
and basic_products.manufactory LIKE concat('%', #{manufactory}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
|
||||||
|
AND basic_products.zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="originUuid != null and originUuid != ''">
|
||||||
|
and basic_products.originUuid = #{originUuid}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue