Compare commits
22 Commits
Author | SHA1 | Date |
---|---|---|
|
90906563f7 | 2 years ago |
|
8e103a0012 | 2 years ago |
|
0eafbe950e | 2 years ago |
|
803774b514 | 2 years ago |
|
c91e37fec7 | 2 years ago |
|
0d5f4e69f7 | 2 years ago |
|
98dc99ed2a | 2 years ago |
|
7cdcc7e5bd | 2 years ago |
|
cf057ddfcd | 2 years ago |
|
3dbea4fb1b | 2 years ago |
|
265fc9e99d | 2 years ago |
|
d01a9e8856 | 2 years ago |
|
bf47bb0d7a | 2 years ago |
|
40dd5b1331 | 2 years ago |
|
e56c67ce50 | 2 years ago |
|
f44a0fc8fc | 2 years ago |
|
cdd8207a8a | 2 years ago |
|
c65d96cc17 | 2 years ago |
|
96db2c7404 | 2 years ago |
|
fe542451cf | 2 years ago |
|
a3c4521c16 | 2 years ago |
|
f303cb4565 | 2 years ago |
@ -1,66 +0,0 @@
|
|||||||
package com.glxp.api.aspect;
|
|
||||||
|
|
||||||
import javax.servlet.ReadListener;
|
|
||||||
import javax.servlet.ServletInputStream;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletRequestWrapper;
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
|
|
||||||
import javax.servlet.ReadListener;
|
|
||||||
import javax.servlet.ServletInputStream;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletRequestWrapper;
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用来重新封装request
|
|
||||||
*/
|
|
||||||
public class BodyRequestWrapper extends HttpServletRequestWrapper {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 存放JSON数据主体
|
|
||||||
*/
|
|
||||||
private String body;
|
|
||||||
|
|
||||||
public BodyRequestWrapper(HttpServletRequest request, String context) {
|
|
||||||
super(request);
|
|
||||||
body = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ServletInputStream getInputStream() throws IOException {
|
|
||||||
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body.getBytes("UTF-8"));
|
|
||||||
return new ServletInputStream() {
|
|
||||||
@Override
|
|
||||||
public int read() throws IOException {
|
|
||||||
return byteArrayInputStream.read();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFinished() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isReady() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setReadListener(ReadListener listener) {
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BufferedReader getReader() throws IOException {
|
|
||||||
return new BufferedReader(new InputStreamReader(this.getInputStream()));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
package com.glxp.api.aspect;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.glxp.api.util.Sm2Util;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import javax.servlet.ServletRequest;
|
|
||||||
import javax.servlet.ServletResponse;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.*;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求加解密过滤器
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class RequestHandler implements Filter {
|
|
||||||
/**
|
|
||||||
* 进行请求加密
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
|
||||||
// form-data不校验
|
|
||||||
if ("application/x-www-form-urlencoded".equals(request.getContentType())) {
|
|
||||||
chain.doFilter(request, response);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 拿到加密串
|
|
||||||
String data = new RequestWrapper((HttpServletRequest) request).getBody();
|
|
||||||
if (StringUtils.isEmpty(data)) {
|
|
||||||
chain.doFilter(request, response);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 解析
|
|
||||||
String body = Sm2Util.decrypt("00e36cfc8d61175584333e6160c645700f2a4659f5908c1bed5824423eab1a1626", JSON.parseObject(data).getString("data"));
|
|
||||||
log.info(body);
|
|
||||||
request = new BodyRequestWrapper((HttpServletRequest) request, body);
|
|
||||||
chain.doFilter(request, response);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,95 +0,0 @@
|
|||||||
package com.glxp.api.aspect;
|
|
||||||
|
|
||||||
import javax.servlet.ReadListener;
|
|
||||||
import javax.servlet.ServletInputStream;
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletRequestWrapper;
|
|
||||||
import java.io.*;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用来读取body
|
|
||||||
*/
|
|
||||||
public class RequestWrapper extends HttpServletRequestWrapper {
|
|
||||||
private final String body;
|
|
||||||
|
|
||||||
public RequestWrapper(HttpServletRequest request) {
|
|
||||||
super(request);
|
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
|
||||||
BufferedReader bufferedReader = null;
|
|
||||||
InputStream inputStream = null;
|
|
||||||
try {
|
|
||||||
inputStream = request.getInputStream();
|
|
||||||
if (inputStream != null) {
|
|
||||||
bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
|
|
||||||
char[] charBuffer = new char[128];
|
|
||||||
int bytesRead = -1;
|
|
||||||
while ((bytesRead = bufferedReader.read(charBuffer)) > 0) {
|
|
||||||
stringBuilder.append(charBuffer, 0, bytesRead);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
stringBuilder.append("");
|
|
||||||
}
|
|
||||||
} catch (IOException ex) {
|
|
||||||
|
|
||||||
} finally {
|
|
||||||
if (inputStream != null) {
|
|
||||||
try {
|
|
||||||
inputStream.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (bufferedReader != null) {
|
|
||||||
try {
|
|
||||||
bufferedReader.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
body = stringBuilder.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ServletInputStream getInputStream() throws IOException {
|
|
||||||
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body.getBytes());
|
|
||||||
ServletInputStream servletInputStream = new ServletInputStream() {
|
|
||||||
@Override
|
|
||||||
public boolean isFinished() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isReady() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setReadListener(ReadListener readListener) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int read() throws IOException {
|
|
||||||
return byteArrayInputStream.read();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return servletInputStream;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BufferedReader getReader() throws IOException {
|
|
||||||
return new BufferedReader(new InputStreamReader(this.getInputStream()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBody() {
|
|
||||||
return this.body;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
package com.glxp.api.controller.sync;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
||||||
import com.glxp.api.annotation.Log;
|
|
||||||
import com.glxp.api.common.res.BaseResponse;
|
|
||||||
import com.glxp.api.common.util.ResultVOUtils;
|
|
||||||
import com.glxp.api.constant.BusinessType;
|
|
||||||
import com.glxp.api.dao.basic.BasicProductsDao;
|
|
||||||
import com.glxp.api.dao.basic.CompanyProductRelevanceDao;
|
|
||||||
import com.glxp.api.dao.basic.UdiRelevanceDao;
|
|
||||||
import com.glxp.api.entity.basic.UdiRelevanceEntity;
|
|
||||||
import com.glxp.api.req.sync.SpsSyncBasicRlRequest;
|
|
||||||
import com.glxp.api.req.system.DeleteRequest;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@Api(tags = "内网基础信息同步修改")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Slf4j
|
|
||||||
public class SpsSyncBasicController {
|
|
||||||
|
|
||||||
private final UdiRelevanceDao udiRelevanceDao;
|
|
||||||
private final BasicProductsDao basicProductsDao;
|
|
||||||
private final CompanyProductRelevanceDao relevanceDao;
|
|
||||||
|
|
||||||
@AuthRuleAnnotation("")
|
|
||||||
@PostMapping("/spssync/basic/udirl/update")
|
|
||||||
@Log(title = "内网同步修改基础数据", businessType = BusinessType.UPDATE)
|
|
||||||
public BaseResponse udiRlUpdate(@RequestBody UdiRelevanceEntity udiRelevanceEntity) {
|
|
||||||
|
|
||||||
if (udiRelevanceEntity.getId() == null) {
|
|
||||||
return ResultVOUtils.error(500, "缺少唯一标识");
|
|
||||||
}
|
|
||||||
int b = udiRelevanceDao.updateById(udiRelevanceEntity);
|
|
||||||
if (b > 0)
|
|
||||||
return ResultVOUtils.success("更新成功!");
|
|
||||||
else
|
|
||||||
return ResultVOUtils.error(500, "更新失败!");
|
|
||||||
}
|
|
||||||
|
|
||||||
@AuthRuleAnnotation("")
|
|
||||||
@PostMapping("/spssync/basic/udirl/batchInsert")
|
|
||||||
@Log(title = "内网同步修改基础数据", businessType = BusinessType.UPDATE)
|
|
||||||
public BaseResponse udiRlUpdate(@RequestBody SpsSyncBasicRlRequest spsSyncBasicRlRequest) {
|
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(spsSyncBasicRlRequest.getUdiRelevanceEntities())) {
|
|
||||||
udiRelevanceDao.replaceBatchs(spsSyncBasicRlRequest.getUdiRelevanceEntities());
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(spsSyncBasicRlRequest.getBasicProductsEntities())) {
|
|
||||||
basicProductsDao.replaceBatchs(spsSyncBasicRlRequest.getBasicProductsEntities());
|
|
||||||
}
|
|
||||||
if (CollectionUtil.isNotEmpty(spsSyncBasicRlRequest.getCompanyProductRelevanceEntities())) {
|
|
||||||
relevanceDao.replaceBatchs(spsSyncBasicRlRequest.getCompanyProductRelevanceEntities());
|
|
||||||
}
|
|
||||||
return ResultVOUtils.success("同步成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
package com.glxp.api.controller.thrsys;
|
|
||||||
|
|
||||||
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.entity.thrsys.ThrProductTypeEntity;
|
|
||||||
import com.glxp.api.req.thrsys.FilterThrProductTypeRequest;
|
|
||||||
import com.glxp.api.res.PageSimpleResponse;
|
|
||||||
import com.glxp.api.service.thrsys.ThrProductTypeService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.validation.BindingResult;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
public class ThrProductTypeCotroller {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
ThrProductTypeService thrProductTypeService;
|
|
||||||
|
|
||||||
@AuthRuleAnnotation("")
|
|
||||||
@GetMapping("/udiwms/thrsys/getThrProductType")
|
|
||||||
public BaseResponse getProductTypes(FilterThrProductTypeRequest filterThrProductTypeRequest,
|
|
||||||
BindingResult bindingResult) {
|
|
||||||
|
|
||||||
if (bindingResult.hasErrors()) {
|
|
||||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
||||||
}
|
|
||||||
List<ThrProductTypeEntity> thrProductTypeEntityList
|
|
||||||
= thrProductTypeService.getProductTypes(filterThrProductTypeRequest);
|
|
||||||
PageInfo<ThrProductTypeEntity> pageInfo;
|
|
||||||
pageInfo = new PageInfo<ThrProductTypeEntity>(thrProductTypeEntityList);
|
|
||||||
PageSimpleResponse<ThrProductTypeEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
|
||||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
|
||||||
pageSimpleResponse.setList(thrProductTypeEntityList);
|
|
||||||
return ResultVOUtils.success(pageSimpleResponse);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
package com.glxp.api.dao.thrsys;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.glxp.api.entity.thrsys.ThrProductTypeEntity;
|
|
||||||
import com.glxp.api.req.thrsys.FilterThrProductTypeRequest;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface ThrProductTypeMapper extends BaseMapper<ThrProductTypeEntity> {
|
|
||||||
|
|
||||||
List<ThrProductTypeEntity> getProductTypes(FilterThrProductTypeRequest filterThrProductTypeRequest);
|
|
||||||
|
|
||||||
}
|
|
@ -1,56 +0,0 @@
|
|||||||
package com.glxp.api.entity.thrsys;
|
|
||||||
|
|
||||||
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 io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
@ApiModel(value = "com-glxp-api-entity-thrsys-ThrProductType")
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@TableName(value = "thr_product_type")
|
|
||||||
public class ThrProductTypeEntity implements Serializable {
|
|
||||||
@TableId(value = "id", type = IdType.INPUT)
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类别编码
|
|
||||||
*/
|
|
||||||
@TableField(value = "code")
|
|
||||||
@ApiModelProperty(value = "类别编码")
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类别名称
|
|
||||||
*/
|
|
||||||
@TableField(value = "`name`")
|
|
||||||
@ApiModelProperty(value = "类别名称")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 第三系统标识
|
|
||||||
*/
|
|
||||||
@TableField(value = "thirdSys")
|
|
||||||
@ApiModelProperty(value = "第三系统标识")
|
|
||||||
private String thirdSys;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
@TableField(value = "remark")
|
|
||||||
@ApiModelProperty(value = "备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package com.glxp.api.req.sync;
|
|
||||||
|
|
||||||
import com.glxp.api.entity.basic.BasicProductsEntity;
|
|
||||||
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
|
|
||||||
import com.glxp.api.entity.basic.UdiRelevanceEntity;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class SpsSyncBasicRlRequest {
|
|
||||||
|
|
||||||
private List<UdiRelevanceEntity> udiRelevanceEntities;
|
|
||||||
private List<CompanyProductRelevanceEntity> companyProductRelevanceEntities;
|
|
||||||
private List<BasicProductsEntity> basicProductsEntities;
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
package com.glxp.api.req.thrsys;
|
|
||||||
|
|
||||||
import com.glxp.api.util.page.ListPageRequest;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class FilterThrProductTypeRequest extends ListPageRequest {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类别编码
|
|
||||||
*/
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类别名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 第三系统标识
|
|
||||||
*/
|
|
||||||
private String thirdSys;
|
|
||||||
|
|
||||||
private String key;
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
package com.glxp.api.service.thrsys;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.github.pagehelper.PageHelper;
|
|
||||||
import com.glxp.api.dao.thrsys.ThrProductTypeMapper;
|
|
||||||
import com.glxp.api.entity.thrsys.ThrProductTypeEntity;
|
|
||||||
import com.glxp.api.req.thrsys.FilterThrProductTypeRequest;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ThrProductTypeService extends ServiceImpl<ThrProductTypeMapper, ThrProductTypeEntity> {
|
|
||||||
@Resource
|
|
||||||
ThrProductTypeMapper thrProductTypeMapper;
|
|
||||||
|
|
||||||
public List<ThrProductTypeEntity> getProductTypes(FilterThrProductTypeRequest filterThrProductTypeRequest) {
|
|
||||||
if (filterThrProductTypeRequest == null) {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
if (filterThrProductTypeRequest.getPage() != null) {
|
|
||||||
int offset = (filterThrProductTypeRequest.getPage() - 1) * filterThrProductTypeRequest.getLimit();
|
|
||||||
PageHelper.offsetPage(offset, filterThrProductTypeRequest.getLimit());
|
|
||||||
}
|
|
||||||
List<ThrProductTypeEntity> data = thrProductTypeMapper.getProductTypes(filterThrProductTypeRequest);
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.glxp.api.dao.thrsys.ThrProductTypeMapper">
|
|
||||||
<resultMap id="BaseResultMap" type="com.glxp.api.entity.thrsys.ThrProductTypeEntity">
|
|
||||||
<!--@mbg.generated-->
|
|
||||||
<!--@Table thr_product_type-->
|
|
||||||
<id column="id" jdbcType="INTEGER" property="id"/>
|
|
||||||
<result column="code" jdbcType="VARCHAR" property="code"/>
|
|
||||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
||||||
<result column="thirdSys" jdbcType="VARCHAR" property="thirdSys"/>
|
|
||||||
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
<!--@mbg.generated-->
|
|
||||||
id, code, `name`, thirdSys, remark
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
|
|
||||||
<select id="getProductTypes" parameterType="com.glxp.api.req.thrsys.FilterThrProductTypeRequest"
|
|
||||||
resultType="com.glxp.api.entity.thrsys.ThrProductTypeEntity">
|
|
||||||
SELECT *
|
|
||||||
FROM thr_product_type
|
|
||||||
<where>
|
|
||||||
<if test="key != '' and key != null">
|
|
||||||
AND (code LIKE concat('%', #{key}, '%') or name LIKE concat('%', #{key}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
<if test="code != '' and code != null">
|
|
||||||
AND code = #{code}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
Loading…
Reference in New Issue