Commit 4c9f1e90 authored by chenyan's avatar chenyan

2024/05/08_API文档后台管理开发

parent e8959f7e
package com.upyuns.platform.rs.website.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* @TableName api_custom_node
*/
@Data
public class ApiCustomNodeDTO extends PageParam implements Serializable {
/**
* api_doc主键ID
*/
private Long docId;
/**
* 父文件夹ID
*/
private Long parentId;
/**
* 节点类型 0=目录 1=接口
*/
private Byte nodeType;
/**
* 节点名称
*/
private String nodeName;
/**
* 路由
*/
private String path;
/**
* 状态:1.上架 2.下架
*/
private Byte status;
}
package com.upyuns.platform.rs.website.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
*
* @TableName api_custom_params
*/
@Data
public class ApiCustomParamsDTO extends PageParam implements Serializable {
/**
* api_doc主键ID
*/
private Long docId;
/**
* 节点ID
*/
private Long nodeId;
/**
* 请求方式:get、head、post、put、patch、delete、options、trace
*/
private String method;
/**
* 接口url
*/
private String apiUrl;
/**
* 状态:1.上架 2.下架
*/
private Byte status;
}
......@@ -3,10 +3,47 @@ package com.upyuns.platform.rs.website.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
@Data
public class ApiDocDTO extends PageParam {
public class ApiDocDTO extends PageParam implements Serializable {
private String keyWord;
/**
* 文档名称
*/
private String name;
/**
* 文档类型
*/
private Byte docType;
/**
* 文档URL地址
*/
private String docUrl;
/**
* 路由
*/
private String path;
/**
* 是否开放访问 0=否 1=是
*/
private Byte openVisit;
/**
* 状态:1.上架 2.下架
*/
private Byte status;
}
package com.upyuns.platform.rs.website.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
@Data
public class TModelTypeDTO extends PageParam implements Serializable {
/**
* 模型类型名称
*/
private String name;
/**
* 状态:1.上架 2.下架
*/
private Byte status;
}
package com.upyuns.platform.rs.website.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.upyuns.platform.rs.website.dto.ApiCustomNodeDTO;
import com.upyuns.platform.rs.website.entity.ApiCustomNode;
import com.upyuns.platform.rs.website.entity.ApiCustomParams;
import com.upyuns.platform.rs.website.entity.ApiDoc;
......@@ -61,6 +67,39 @@ public class ApiCustomNodeBiz extends BaseBiz<ApiCustomNodeMapper, ApiCustomNode
result.put("apiUrlInfo",apiCustomParams);
return ObjectRestResponse.succ(result);
}
public ObjectRestResponse addObj(ApiCustomNode apiCustomNode) {
if (apiCustomNode == null) {
return ObjectRestResponse.paramIsEmpty();
}
//判断文档是否存在
if (Objects.nonNull(apiCustomNode.getDocId()) && apiCustomNode.getDocId() > 0){
Example exampleDoc = new Example(ApiDoc.class);
exampleDoc.createCriteria()
.andEqualTo("id", apiCustomNode.getDocId())
.andEqualTo("isDel",0);
if(apiDocBiz.selectCountByExample(exampleDoc) <= 0){
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "文档不存在");
}
}
if (apiCustomNode.getId() != null) {
ApiCustomNode old = selectById(apiCustomNode.getId());
if (old == null || old.getIsDel() == 1) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, ResultCode.getMsg(ResultCode.NOTEXIST_CODE));
}
BeanUtil.copyProperties(apiCustomNode, old, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
updateSelectiveByIdRe(old);
} else {
insertSelectiveRe(apiCustomNode);
}
return ObjectRestResponse.succ();
}
public ObjectRestResponse getListV2(ApiCustomNodeDTO apiCustomNodeDTO) {
Query query = new Query(apiCustomNodeDTO);
PageDataVO<ApiCustomNode> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectList(query.getSuper()));
return ObjectRestResponse.succ(pageDataVO);
}
}
......
package com.upyuns.platform.rs.website.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.upyuns.platform.rs.website.dto.ApiCustomParamsDTO;
import com.upyuns.platform.rs.website.entity.ApiCustomNode;
import com.upyuns.platform.rs.website.entity.ApiCustomParams;
import com.upyuns.platform.rs.website.entity.ApiDoc;
import com.upyuns.platform.rs.website.mapper.ApiCustomNodeMapper;
import com.upyuns.platform.rs.website.mapper.ApiCustomParamsMapper;
import com.upyuns.platform.rs.website.mapper.ApiDocMapper;
import jodd.util.StringUtil;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.Objects;
/**
*
......@@ -14,6 +30,62 @@ import org.springframework.stereotype.Service;
@Service
public class ApiCustomParamsBiz extends BaseBiz<ApiCustomParamsMapper, ApiCustomParams> {
@Resource
private ApiCustomNodeMapper apiCustomNodeMapper;
@Resource
private ApiDocMapper apiDocMapper;
public ObjectRestResponse addObj(ApiCustomParams apiCustomParams) {
if (apiCustomParams == null) {
return ObjectRestResponse.paramIsEmpty();
}
//判断文档是否存在
if (Objects.nonNull(apiCustomParams.getDocId()) && apiCustomParams.getDocId() > 0){
Example exampleDoc = new Example(ApiDoc.class);
exampleDoc.createCriteria()
.andEqualTo("id", apiCustomParams.getDocId())
.andEqualTo("isDel",0);
if(apiDocMapper.selectCountByExample(exampleDoc) <= 0){
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "文档不存在");
}
}
//判断API节点是否存在
if (Objects.nonNull(apiCustomParams.getNodeId()) && apiCustomParams.getNodeId() > 0){
Example exampleDoc = new Example(ApiCustomNode.class);
exampleDoc.createCriteria()
.andEqualTo("id", apiCustomParams.getNodeId())
.andEqualTo("isDel",0);
if(apiCustomNodeMapper.selectCountByExample(exampleDoc) <= 0){
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "API节点不存在");
}
Example exampleParams = new Example(ApiCustomParams.class);
exampleParams.createCriteria()
.andNotEqualTo("id", apiCustomParams.getId() != null? apiCustomParams.getId() : 0)
.andEqualTo("nodeId", apiCustomParams.getNodeId())
.andEqualTo("isDel",0);
if(mapper.selectCountByExample(exampleParams) > 0){
return ObjectRestResponse.createFailedResult(ResultCode.EXIST_CODE, "API节点下已存在自定义参数");
}
}
if (apiCustomParams.getId() != null) {
ApiCustomParams old = selectById(apiCustomParams.getId());
if (old == null || old.getIsDel() == 1) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, ResultCode.getMsg(ResultCode.NOTEXIST_CODE));
}
BeanUtil.copyProperties(apiCustomParams, old, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
updateSelectiveByIdRe(old);
} else {
insertSelectiveRe(apiCustomParams);
}
return ObjectRestResponse.succ();
}
public ObjectRestResponse getListV2(ApiCustomParamsDTO apiCustomParamsDTO) {
Query query = new Query(apiCustomParamsDTO);
PageDataVO<ApiCustomParams> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectList(query.getSuper()));
return ObjectRestResponse.succ(pageDataVO);
}
}
......
package com.upyuns.platform.rs.website.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.upyuns.platform.rs.website.dto.ApiDocDTO;
import com.upyuns.platform.rs.website.entity.ApiCustomNode;
import com.upyuns.platform.rs.website.entity.ApiCustomParams;
import com.upyuns.platform.rs.website.entity.ApiDoc;
import com.upyuns.platform.rs.website.entity.OrderItem;
import com.upyuns.platform.rs.website.entity.*;
import com.upyuns.platform.rs.website.mapper.ApiCustomNodeMapper;
import com.upyuns.platform.rs.website.mapper.ApiCustomParamsMapper;
import com.upyuns.platform.rs.website.mapper.ApiDocMapper;
......@@ -18,12 +19,10 @@ import com.upyuns.platform.rs.website.vo.ApiCustomNodeVo;
import com.upyuns.platform.rs.website.vo.ApiDocTreeVo;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
......@@ -80,6 +79,29 @@ public class ApiDocBiz extends BaseBiz<ApiDocMapper, ApiDoc> {
}
return ObjectRestResponse.succ(docTreeVoList);
}
public ObjectRestResponse addObj(ApiDoc apiDoc) {
if (apiDoc == null) {
return ObjectRestResponse.paramIsEmpty();
}
if (apiDoc.getId() != null) {
ApiDoc old = selectById(apiDoc.getId());
if (old == null || old.getIsDel() == 1) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, ResultCode.getMsg(ResultCode.NOTEXIST_CODE));
}
BeanUtil.copyProperties(apiDoc, old, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
updateSelectiveByIdRe(old);
} else {
insertSelectiveRe(apiDoc);
}
return ObjectRestResponse.succ();
}
public ObjectRestResponse getListV2(ApiDocDTO apiDocDTO) {
Query query = new Query(apiDocDTO);
PageDataVO<ApiDoc> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectListV2(query.getSuper()));
return ObjectRestResponse.succ(pageDataVO);
}
}
......
package com.upyuns.platform.rs.website.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.upyuns.platform.rs.website.dto.TModelTypeDTO;
import com.upyuns.platform.rs.website.entity.TModel;
import com.upyuns.platform.rs.website.entity.TModelType;
import com.upyuns.platform.rs.website.mapper.TModelMapper;
......@@ -47,4 +53,26 @@ public class TModelTypeBiz extends BaseBiz<TModelTypeMapper, TModelType> {
return vo;
}
public ObjectRestResponse addObj(TModelType tModelType) {
if (tModelType == null) {
return ObjectRestResponse.paramIsEmpty();
}
if (tModelType.getId() != null) {
TModelType old = selectById(tModelType.getId());
if (old == null || old.getIsDel() == 1) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, ResultCode.getMsg(ResultCode.NOTEXIST_CODE));
}
BeanUtil.copyProperties(tModelType, old, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
updateSelectiveByIdRe(old);
} else {
insertSelectiveRe(tModelType);
}
return ObjectRestResponse.succ();
}
public ObjectRestResponse getList(TModelTypeDTO tModelTypeDTO) {
Query query = new Query(tModelTypeDTO);
PageDataVO<TModelType> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectList(query.getSuper()));
return ObjectRestResponse.succ(pageDataVO);
}
}
package com.upyuns.platform.rs.website.controller;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.upyuns.platform.rs.website.biz.ApiCustomNodeBiz;
import com.upyuns.platform.rs.website.biz.ApiCustomParamsBiz;
import com.upyuns.platform.rs.website.dto.ApiCustomNodeDTO;
import com.upyuns.platform.rs.website.dto.ApiCustomParamsDTO;
import com.upyuns.platform.rs.website.entity.ApiCustomNode;
import com.upyuns.platform.rs.website.entity.ApiCustomParams;
import com.upyuns.platform.rs.website.mapper.ApiCustomParamsMapper;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
/**
*
*/
@RestController
@RequestMapping("apiCustomParams")
public class ApiCustomParamsController extends BaseController<ApiCustomParamsBiz, ApiCustomParams> {
@PostMapping(value = "/addUpdate")
public ObjectRestResponse addUpdate(@RequestBody ApiCustomParams apiCustomParams) {
return baseBiz.addObj(apiCustomParams);
}
@PostMapping(value = "/getList")
public ObjectRestResponse getList(@RequestBody ApiCustomParamsDTO apiCustomParamsDTO) {
return baseBiz.getListV2(apiCustomParamsDTO);
}
@GetMapping(value = "/detail")
public ObjectRestResponse detail(Integer id) {
return ObjectRestResponse.succ(baseBiz.selectById(id));
}
}
......@@ -38,6 +38,25 @@ public class TModelController extends BaseController<TModelBiz, TModel> {
}
@PostMapping(value = "/addUpdate")
public ObjectRestResponse addUpdateV2(@RequestBody TModel tModel) {
return baseBiz.addObj(tModel);
}
@PostMapping(value = "/getList")
public ObjectRestResponse getListV2(@RequestBody TModelDTO tModelDTO) {
return baseBiz.getList(tModelDTO);
}
@GetMapping(value = "/detail")
public ObjectRestResponse detailV2(Integer id) {
return ObjectRestResponse.succ(baseBiz.selectById(id));
}
// @PostMapping(value = "delete/{id}")
// public ObjectRestResponse remove(@PathVariable Integer id) {
// return baseBiz.remove(id);
......
......@@ -6,11 +6,11 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.upyuns.platform.rs.website.biz.TModelBiz;
import com.upyuns.platform.rs.website.biz.TModelTypeBiz;
import com.upyuns.platform.rs.website.dto.TModelDTO;
import com.upyuns.platform.rs.website.dto.TModelTypeDTO;
import com.upyuns.platform.rs.website.entity.TModel;
import com.upyuns.platform.rs.website.entity.TModelType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
......@@ -30,4 +30,22 @@ public class TModelTypeController extends BaseController<TModelTypeBiz, TModelTy
}
@PostMapping(value = "/addUpdate")
public ObjectRestResponse addUpdateV2(@RequestBody TModelType tModelType) {
return baseBiz.addObj(tModelType);
}
@PostMapping(value = "/getList")
public ObjectRestResponse getListV2(@RequestBody TModelTypeDTO tModelTypeDTO) {
return baseBiz.getList(tModelTypeDTO);
}
@GetMapping(value = "/detail")
public ObjectRestResponse detailV2(Integer id) {
return ObjectRestResponse.succ(baseBiz.selectById(id));
}
}
......@@ -6,12 +6,11 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.upyuns.platform.rs.website.biz.ApiCustomNodeBiz;
import com.upyuns.platform.rs.website.biz.ApiDocBiz;
import com.upyuns.platform.rs.website.dto.ApiCustomNodeDTO;
import com.upyuns.platform.rs.website.dto.ApiDocDTO;
import com.upyuns.platform.rs.website.entity.ApiCustomNode;
import com.upyuns.platform.rs.website.entity.ApiDoc;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("apiCustomNode")
......@@ -41,6 +40,24 @@ public class apiCustomNodeController extends BaseController<ApiCustomNodeBiz, Ap
}
@PostMapping(value = "/addUpdate")
public ObjectRestResponse addUpdate(@RequestBody ApiCustomNode apiCustomNode) {
return baseBiz.addObj(apiCustomNode);
}
@PostMapping(value = "/getList")
public ObjectRestResponse getList(@RequestBody ApiCustomNodeDTO apiCustomNodeDTO) {
return baseBiz.getListV2(apiCustomNodeDTO);
}
@GetMapping(value = "/detail")
public ObjectRestResponse detail(Integer id) {
return baseBiz.getListById(id);
}
}
......@@ -6,27 +6,17 @@ import com.github.wxiaoqi.security.common.rest.BaseController;
import com.upyuns.platform.rs.website.biz.ApiDocBiz;
import com.upyuns.platform.rs.website.biz.BannerBiz;
import com.upyuns.platform.rs.website.dto.ApiDocDTO;
import com.upyuns.platform.rs.website.dto.TModelTypeDTO;
import com.upyuns.platform.rs.website.entity.ApiDoc;
import com.upyuns.platform.rs.website.entity.Banner;
import com.upyuns.platform.rs.website.entity.TModel;
import com.upyuns.platform.rs.website.entity.TModelType;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("apiDoc")
public class apiDocController extends BaseController<ApiDocBiz, ApiDoc> {
// /**
// * 查询文档列表
// * @return
// */
// @GetMapping(value = "/app/unauth/addUpdate/tree")
// @IgnoreUserToken
// public ObjectRestResponse getTree() {
// return baseBiz.getTree();
// }
@PostMapping(value = "/app/unauth/list")
@IgnoreUserToken
public ObjectRestResponse list(@RequestBody ApiDocDTO apiDocDTO) {
......@@ -34,7 +24,22 @@ public class apiDocController extends BaseController<ApiDocBiz, ApiDoc> {
}
@PostMapping(value = "/addUpdate")
public ObjectRestResponse addUpdate(@RequestBody ApiDoc apiDoc) {
return baseBiz.addObj(apiDoc);
}
@PostMapping(value = "/getList")
public ObjectRestResponse getList(@RequestBody ApiDocDTO apiDocDTO) {
return baseBiz.getListV2(apiDocDTO);
}
@GetMapping(value = "/detail")
public ObjectRestResponse detail(Integer id) {
return ObjectRestResponse.succ(baseBiz.selectById(id));
}
......
......@@ -3,14 +3,19 @@ package com.upyuns.platform.rs.website.mapper;
import com.upyuns.platform.rs.website.entity.ApiCustomNode;
import tk.mybatis.mapper.common.Mapper;
import java.util.LinkedHashMap;
import java.util.List;
/**
* @Entity generator.domain.ApiCustomNode
*/
public interface ApiCustomNodeMapper extends Mapper<ApiCustomNode> {
List<ApiCustomNode> selectList(LinkedHashMap<String, Object> aSuper);
}
......@@ -5,12 +5,16 @@ package com.upyuns.platform.rs.website.mapper;
import com.upyuns.platform.rs.website.entity.ApiCustomParams;
import tk.mybatis.mapper.common.Mapper;
import java.util.LinkedHashMap;
import java.util.List;
/**
* @Entity generator.domain.ApiCustomParams
*/
public interface ApiCustomParamsMapper extends Mapper<ApiCustomParams> {
List<ApiCustomParams> selectList(LinkedHashMap<String, Object> aSuper);
}
......
......@@ -17,6 +17,8 @@ public interface ApiDocMapper extends Mapper<ApiDoc> {
List<ApiDocTreeVo> selectList(LinkedHashMap<String, Object> aSuper);
List<ApiDoc> selectListV2(LinkedHashMap<String, Object> params);
}
......
......@@ -4,5 +4,9 @@ import com.upyuns.platform.rs.website.entity.TModel;
import com.upyuns.platform.rs.website.entity.TModelType;
import tk.mybatis.mapper.common.Mapper;
import java.util.LinkedHashMap;
import java.util.List;
public interface TModelTypeMapper extends Mapper<TModelType> {
List<TModelType> selectList(LinkedHashMap<String, Object> aSuper);
}
......@@ -28,4 +28,31 @@
is_del,create_time,create_user,
last_update_time,last_update_user
</sql>
<select id="selectList" resultType="com.upyuns.platform.rs.website.entity.ApiCustomNode">
SELECT *
FROM api_custom_node
WHERE is_del = 0
<if test="docId!= null">
AND doc_id = #{docId}
</if>
<if test="parentId!= null">
AND parent_id = #{parentId}
</if>
<if test="nodeType!= null">
AND node_type = #{nodeType}
</if>
<if test="nodeName!= null and nodeName!= ''">
AND node_name LIKE CONCAT('%', #{nodeName}, '%')
</if>
<if test="nodeDesc!= null and nodeDesc!= ''">
AND node_desc LIKE CONCAT('%', #{nodeDesc}, '%')
</if>
<if test="path != null and path != ''">
AND `path` LIKE CONCAT('%',#{path}, '%')
</if>
<if test="status != null">
AND `status` = #{status}
</if>
ORDER BY seq_no DESC
</select>
</mapper>
......@@ -29,4 +29,25 @@
status,is_del,create_time,
create_user,last_update_time,last_update_user
</sql>
<select id="selectList" resultType="com.upyuns.platform.rs.website.entity.ApiCustomParams">
SELECT *
FROM api_custom_params
WHERE is_del = 0
<if test="docId!= null">
AND doc_id = #{docId}
</if>
<if test="nodeId!= null">
AND node_id = #{nodeId}
</if>
<if test="method!= null and method!= ''">
AND method = #{method}
</if>
<if test="apiUrl!= null and apiUrl!= ''">
AND api_url = concat('%', #{apiUrl}, '%')
</if>
<if test="status != null">
AND `status` = #{status}
</if>
ORDER BY `create_time`,`id` desc
</select>
</mapper>
......@@ -23,7 +23,7 @@
</resultMap>
<sql id="Base_Column_List">
id,name,doc_type,
id,`name`,doc_type,
doc_url,json_content,rewrite_domain,
open_visit,share_uuid,
share_instruction,status,is_del,
......@@ -46,4 +46,43 @@
d.id
ORDER BY d.create_time,d.id desc
</select>
<select id="selectListV2" resultType="com.upyuns.platform.rs.website.entity.ApiDoc">
SELECT
ad.`id`,
ad.`name`,
ad.doc_type,
ad.doc_url,
ad.path,
ad.json_content,
ad.rewrite_domain,
ad.open_visit,
ad.share_uuid,
ad.share_instruction,
ad.`status`,
ad.create_time,
ad.create_user,
ad.last_update_time,
ad.last_update_user
FROM api_doc ad
WHERE ad.`is_del` = 0
<if test="name != null and name != ''">
AND ad.`name` LIKE concat( '%', #{name}, '%' )
</if>
<if test="docType != null">
AND ad.`doc_type` = #{docType}
</if>
<if test="status != null">
AND ad.`status` = #{status}
</if>
<if test="docUrl != null and docUrl != ''">
AND ad.`doc_url` LIKE concat( '%', #{docUrl}, '%' )
</if>
<if test="path != null and path != ''">
AND ad.`path` LIKE concat( '%', #{path}, '%' )
</if>
<if test="openVisit != null and openVisit != 0">
AND ad.`open_visit` = #{openVisit}
</if>
ORDER BY ad.create_time,ad.id desc
</select>
</mapper>
......@@ -4,4 +4,15 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.upyuns.platform.rs.website.mapper.TModelTypeMapper">
<select id="selectList" resultType="com.upyuns.platform.rs.website.entity.TModelType">
SELECT * FROM t_model_type
WHERE is_del = 0
<if test="name!= null and name!= ''">
AND name LIKE concat('%', #{name}, '%')
</if>
<if test="status!= null">
AND status = #{status}
</if>
ORDER BY create_time,id desc
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment