优化应用查询接口
This commit is contained in:
@@ -10,7 +10,6 @@ import java.util.List;
|
||||
@Data
|
||||
public class GetFlowTemplateReq {
|
||||
|
||||
|
||||
public String templateName;
|
||||
|
||||
public String templateType;
|
||||
|
||||
@@ -37,9 +37,9 @@ public class SimulationAppCenterController {
|
||||
|
||||
@GetMapping(value = "/queryAllApplication")
|
||||
@ResponseBody
|
||||
SdmResponse queryAllSimulationApplication()
|
||||
SdmResponse queryAllSimulationApplication(@RequestParam("appName")String appName,@RequestParam("current")int current,@RequestParam("size")int size)
|
||||
{
|
||||
return service.querySimulationAllApp();
|
||||
return service.querySimulationAllApp(appName,current,size);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/queryApplicationByType")
|
||||
|
||||
@@ -21,6 +21,9 @@ public interface SimulationAppManageMapper {
|
||||
@Select("SELECT * FROM simulation_app_repository WHERE ${condition}")
|
||||
List<AppCenterItemBean> querySimulationAppByCondition(@Param("condition") String condition);
|
||||
|
||||
@Select("SELECT COUNT(*) FROM simulation_app_repository WHERE ${condition}")
|
||||
int querySimulationAppByConditionCount(@Param("condition") String condition);
|
||||
|
||||
@Insert("INSERT INTO simulation_app_configure(appId,appName,configName,configType,configValue,comment,creator) VALUES(#{appConfig.appId},#{appConfig.appName},#{appConfig.configName},#{appConfig.configType},#{appConfig.configValue},#{appConfig.comment},#{appConfig.creator})")
|
||||
int addSimulationAppConfig(@Param("appConfig")AppConfigureBean appConfig);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public interface ISimulatinoAppCenterService {
|
||||
* 查询应用中心所有应用
|
||||
* @return
|
||||
*/
|
||||
SdmResponse querySimulationAllApp();
|
||||
SdmResponse querySimulationAllApp(String appName,int current,int size);
|
||||
|
||||
/**
|
||||
* 根据类型查询应用
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.sdm.system.service.impl;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.common.ThreadLocalContext;
|
||||
import com.sdm.common.entity.bo.DataPageInfo;
|
||||
import com.sdm.common.service.BaseService;
|
||||
import com.sdm.common.utils.excel.*;
|
||||
import com.sdm.system.dao.SimulationAppManageMapper;
|
||||
import com.sdm.system.model.entity.AppCenterItemBean;
|
||||
import com.sdm.system.model.entity.AppConfigureBean;
|
||||
@@ -109,11 +109,21 @@ public class SimulationAppCenterServiceImpl extends BaseService implements ISimu
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SdmResponse querySimulationAllApp() {
|
||||
public SdmResponse querySimulationAllApp(String appName,int current,int size) {
|
||||
SdmResponse response = SdmResponse.success();
|
||||
String queryCondition = "true";
|
||||
List<AppCenterItemBean> appBeans = appManageMapper.querySimulationAppByCondition(queryCondition);
|
||||
response.setData(appBeans);
|
||||
if(appName != null && !appName.isEmpty())
|
||||
{
|
||||
queryCondition += " AND appName LIKE '%"+appName+"%'" ;
|
||||
}
|
||||
int total = appManageMapper.querySimulationAppByConditionCount(queryCondition);
|
||||
int offset = (current - 1) * size;
|
||||
String limitQueryCondition = queryCondition+" LIMIT "+offset+", "+size;
|
||||
List<AppCenterItemBean> appBeans = appManageMapper.querySimulationAppByCondition(limitQueryCondition);
|
||||
DataPageInfo pageInfo = new DataPageInfo();
|
||||
pageInfo.total = total;
|
||||
pageInfo.data = appBeans;
|
||||
response.setData(pageInfo);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user