修改接口

This commit is contained in:
huangzj
2023-04-17 14:14:56 +08:00
parent 460b46adf0
commit 8e263ad50a
7 changed files with 42 additions and 44 deletions

View File

@@ -24,8 +24,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
@@ -80,14 +78,14 @@ public class DevModelController extends BaseController {
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryEquipmentByProject")
@PostMapping("/queryDevModelOne")
@ApiOperation("设备模板列表查询")
@ApiImplicitParam(name = "csDevModelQueryListParm", value = "信息", required = true)
public HttpResult<List<CsDevModelPageVO>> queryEquipmentByProject(@RequestBody CsDevModelQueryListParm csDevModelQueryListParm){
String methodDescribe = getMethodDescribe("queryEquipmentByProject");
public HttpResult<CsDevModelPageVO> queryDevModelOne(@RequestBody CsDevModelQueryListParm csDevModelQueryListParm){
String methodDescribe = getMethodDescribe("queryDevModelOne");
List<CsDevModelPageVO> list = csDevModelService.queryList(csDevModelQueryListParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
CsDevModelPageVO csDevModelPageVO = csDevModelService.queryDevModelOne(csDevModelQueryListParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csDevModelPageVO, methodDescribe);
}

View File

@@ -8,8 +8,6 @@ import com.njcn.algorithm.pojo.po.CsDevModelPO;
import com.njcn.algorithm.pojo.vo.CsDevModelPageVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
* Description:
@@ -22,5 +20,5 @@ import java.util.List;
public interface CsDevModelMapper extends BaseMapper<CsDevModelPO> {
Page<CsDevModelPageVO> getPage(Page<CsDevModelPageVO> returnpage,@Param("csDevModelQueryParm") CsDevModelQueryParm csDevModelQueryParm);
List<CsDevModelPageVO> queryList(@Param("csDevModelQueryListParm")CsDevModelQueryListParm csDevModelQueryListParm);
CsDevModelPageVO queryOne(@Param("csDevModelQueryListParm")CsDevModelQueryListParm csDevModelQueryListParm);
}

View File

@@ -42,19 +42,19 @@
<if test="csDevModelQueryParm.name != null and csDevModelQueryParm.name != ''">
AND a.name = #{csDevModelQueryParm.name}
</if>
</select><select id="queryList" resultType="com.njcn.algorithm.pojo.vo.CsDevModelPageVO">
</select><select id="queryOne" resultType="com.njcn.algorithm.pojo.vo.CsDevModelPageVO">
SELECT a.*,
b.code as devName
FROM cs_dev_model a
LEFT JOIN sys_dict_data b ON a.dev_type = b.id
WHERE
1 = 1 And a.`status`='1'
<if test="csDevModelQueryListParm.versionStartDate != null and csDevModelQueryListParm.versionStartDate != ''">
AND a.version_date &gt;= #{csDevModelQueryListParm.versionStartDate }
</if>
<if test="csDevModelQueryListParm.versionEndDate != null and csDevModelQueryListParm.versionEndDate != ''">
AND a.version_date &lt;= #{csDevModelQueryListParm.versionEndDate }
</if>
<!-- <if test="csDevModelQueryListParm.versionStartDate != null and csDevModelQueryListParm.versionStartDate != ''">-->
<!-- AND a.version_date &gt;= #{csDevModelQueryListParm.versionStartDate }-->
<!-- </if>-->
<!-- <if test="csDevModelQueryListParm.versionEndDate != null and csDevModelQueryListParm.versionEndDate != ''">-->
<!-- AND a.version_date &lt;= #{csDevModelQueryListParm.versionEndDate }-->
<!-- </if>-->
<if test="csDevModelQueryListParm.versionDate != null and csDevModelQueryListParm.versionDate != ''">
AND a.version_date = #{csDevModelQueryListParm.versionDate }

View File

@@ -1,13 +1,14 @@
package com.njcn.algorithm.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.algorithm.pojo.param.*;
import com.njcn.algorithm.pojo.po.CsDevModelPO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.algorithm.pojo.param.CsDevModelAddParm;
import com.njcn.algorithm.pojo.param.CsDevModelAuditParm;
import com.njcn.algorithm.pojo.param.CsDevModelQueryListParm;
import com.njcn.algorithm.pojo.param.CsDevModelQueryParm;
import com.njcn.algorithm.pojo.po.CsDevModelPO;
import com.njcn.algorithm.pojo.vo.CsDevModelPageVO;
import java.util.List;
/**
*
* Description:
@@ -51,5 +52,5 @@ public interface CsDevModelService extends IService<CsDevModelPO>{
* @Date: 2023/4/10
* @param projectEquipmentQueryParm
*/
List<CsDevModelPageVO> queryList(CsDevModelQueryListParm projectEquipmentQueryParm);
CsDevModelPageVO queryDevModelOne(CsDevModelQueryListParm projectEquipmentQueryParm);
}

View File

@@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.algorithm.mapper.CsDevModelMapper;
import com.njcn.algorithm.pojo.param.*;
import com.njcn.algorithm.pojo.param.CsDevModelAddParm;
import com.njcn.algorithm.pojo.param.CsDevModelAuditParm;
import com.njcn.algorithm.pojo.param.CsDevModelQueryListParm;
import com.njcn.algorithm.pojo.param.CsDevModelQueryParm;
import com.njcn.algorithm.pojo.po.CsDevModelPO;
import com.njcn.algorithm.pojo.vo.CsDevModelPageVO;
import com.njcn.algorithm.service.CsDevModelService;
@@ -12,8 +15,6 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* Description:
@@ -55,8 +56,9 @@ public class CsDevModelServiceImpl extends ServiceImpl<CsDevModelMapper, CsDevMo
}
@Override
public List<CsDevModelPageVO> queryList(CsDevModelQueryListParm csDevModelQueryListParm) {
List<CsDevModelPageVO> list = this.getBaseMapper ().queryList(csDevModelQueryListParm);
return list;
public CsDevModelPageVO queryDevModelOne(CsDevModelQueryListParm csDevModelQueryListParm) {
CsDevModelPageVO result = this.getBaseMapper ().queryOne(csDevModelQueryListParm);
return result;
}
}