Commit 00b3d340 by zhangkb

添加基础和考核指标版本信息查询接口

parent 4239b20f
......@@ -11,9 +11,13 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.keymobile.indicators.model.entity.indicators.BaseIndDef;
import com.keymobile.indicators.model.entity.indicators.BaseIndDefVersionData;
import com.keymobile.indicators.model.entity.indicators.DriveIndDef;
import com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData;
import com.keymobile.indicators.service.hytobacco.BaseIndDefService;
import com.keymobile.indicators.service.hytobacco.BaseIndDefVersionService;
import com.keymobile.indicators.service.hytobacco.DriveIndDefService;
import com.keymobile.indicators.service.hytobacco.DriveIndDefVersionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -27,6 +31,16 @@ public class IndicatorsDefCtrl {
private BaseIndDefService baseIndDefService;
@Autowired
private DriveIndDefService driveIndDefService;
@Autowired
private BaseIndDefVersionService baseIndDefVersionService;
@Autowired
private DriveIndDefVersionService driveIndDefVersionService;
@ApiOperation(value = "根据基础指标id获取基础指标版本信息", notes = "根据基础指标id获取基础指标版本信息")
@PostMapping(value = "/getBaseIndDefVersions")
public List<BaseIndDefVersionData> getBaseIndDefVersions(@RequestParam String indId){
return baseIndDefVersionService.getVersionDataByIndId(indId);
}
@ApiOperation(value = "获取基础指标最大id", notes = "获取基础指标最大id")
@PostMapping(value = "/getBaseIndMaxId")
......@@ -66,6 +80,12 @@ public class IndicatorsDefCtrl {
return baseIndDefService.getByPageAndKeyword(catalogId, keyword, page, rows);
}
@ApiOperation(value = "根据考核指标id获取考核指标版本信息", notes = "根据考核指标id获取考核指标版本信息")
@PostMapping(value = "/getDriveIndDefVersions")
public List<DriveIndDefVersionData> getDriveIndDefVersions(@RequestParam String indId){
return driveIndDefVersionService.getVersionDataByIndId(indId);
}
@ApiOperation(value = "获取考核指标最大id", notes = "获取考核指标最大id")
@PostMapping(value = "/getDriveIndMaxId")
public String getDriveIndMaxId(@RequestParam String code,
......
package com.keymobile.indicators.model.mapper.indmapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import com.keymobile.indicators.model.entity.indicators.BaseIndDefVersionData;
......@@ -8,5 +10,5 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper
public interface BaseIndDefVersionDataMapper extends BaseMapper<BaseIndDefVersionData>{
public List<BaseIndDefVersionData> getVersionDataByIndId(String indId);
}
package com.keymobile.indicators.model.mapper.indmapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData;
......@@ -8,5 +10,5 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper
public interface DriveIndDefVersionDataMapper extends BaseMapper<DriveIndDefVersionData>{
public List<DriveIndDefVersionData> getVersionDataByIndId(String indId);
}
package com.keymobile.indicators.service.hytobacco;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -30,4 +32,8 @@ public class BaseIndDefVersionService {
baseIndDefVersionDataMapper.insert(baseIndDefVersionData);
return true;
}
public List<BaseIndDefVersionData> getVersionDataByIndId(String indId){
return baseIndDefVersionDataMapper.getVersionDataByIndId(indId);
}
}
package com.keymobile.indicators.service.hytobacco;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -15,7 +14,6 @@ import org.springframework.stereotype.Service;
import com.keymobile.indicators.model.entity.indicators.DriveIndCatalog;
import com.keymobile.indicators.model.mapper.indicators.DriveIndDefMapper;
import com.keymobile.indicators.model.mapper.indmapper.DriveIndCatalogMapper;
import com.keymobile.indicators.utils.DateUtils;
@Service
public class DriveIndCatalogService {
......@@ -30,8 +28,6 @@ public class DriveIndCatalogService {
if(driveIndCatalog.getId()==null) {//新增
//保存
driveIndCatalogMapper.insert(driveIndCatalog);
}else {
driveIndCatalog.setLastUpdateTime(DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
}
//获取parentId拼接idPath
Integer parentId = driveIndCatalog.getParentId();
......
package com.keymobile.indicators.service.hytobacco;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -30,4 +32,8 @@ public class DriveIndDefVersionService {
driveIndDefVersionDataMapper.insert(driveIndDefVersionData);
return true;
}
public List<DriveIndDefVersionData> getVersionDataByIndId(String indId){
return driveIndDefVersionDataMapper.getVersionDataByIndId(indId);
}
}
package com.keymobile.indicators.service.hytobacco;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -15,7 +14,6 @@ import org.springframework.stereotype.Service;
import com.keymobile.indicators.model.entity.indicators.IndCatalog;
import com.keymobile.indicators.model.mapper.indicators.BaseIndDefMapper;
import com.keymobile.indicators.model.mapper.indmapper.IndCatalogMapper;
import com.keymobile.indicators.utils.DateUtils;
@Service
public class IndCatalogService {
......@@ -30,8 +28,6 @@ public class IndCatalogService {
if(indCatalog.getId()==null) {//新增
//保存
indCatalogMapper.insert(indCatalog);
}else {
indCatalog.setLastUpdateTime(DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
}
//获取parentId拼接idPath
int parentId = indCatalog.getParentId();
......
<?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.keymobile.indicators.model.mapper.indmapper.BaseIndDefVersionDataMapper">
<select id="getVersionDataByIndId" resultType="com.keymobile.indicators.model.entity.indicators.BaseIndDefVersionData">
select *
from base_ind_def_version_data
where ind_id=#{indId}
</select>
</mapper>
\ No newline at end of file
<?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.keymobile.indicators.model.mapper.indmapper.DriveIndDefVersionDataMapper">
<select id="getVersionDataByIndId" resultType="com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData">
select *
from drive_ind_def_version_data
where ind_id=#{indId}
</select>
</mapper>
\ No newline at end of file
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