Commit 47be8c3f by zhangkb

修改mybatis传入参数是list时参数名统一用list

parent 710abc78
...@@ -80,6 +80,12 @@ public class IndScorecardCtrl { ...@@ -80,6 +80,12 @@ public class IndScorecardCtrl {
return indScorecardService.findById(id); return indScorecardService.findById(id);
} }
@ApiOperation(value = "根据idList获取评分卡", notes = "根据idList获取评分卡")
@PostMapping(value = "/findByIdList")
public List<IndScorecard> findByIdList(@RequestParam List<Integer> ids)throws Exception{
return indScorecardService.findByIdList(ids);
}
@ApiOperation(value = "根据评分卡计算指标分数", notes = "根据评分卡计算指标分数") @ApiOperation(value = "根据评分卡计算指标分数", notes = "根据评分卡计算指标分数")
@PostMapping(value = "/calculateIndiScore") @PostMapping(value = "/calculateIndiScore")
public Map<String,String> calculateIndiScore(@RequestParam String indId,@RequestParam int date, public Map<String,String> calculateIndiScore(@RequestParam String indId,@RequestParam int date,
......
package com.keymobile.indicators.api.hytobacco; package com.keymobile.indicators.api.hytobacco;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -92,6 +93,12 @@ public class IndicatorsDefCtrl { ...@@ -92,6 +93,12 @@ public class IndicatorsDefCtrl {
return driveIndDefService.getById(indId); return driveIndDefService.getById(indId);
} }
@ApiOperation(value = "根据考核指标idList获取指标List", notes = "根据考核指标idList获取指标List")
@PostMapping(value = "/getDrivedefByIdList")
public List<DriveIndDef> getDrivedefByIdList(@RequestParam List<String> indIds) throws Exception{
return driveIndDefService.getByIdList(indIds);
}
@ApiOperation(value = "根据考核指标id获取指标详情(包含短板筛选规则信息)", notes = "根据考核指标id获取指标详情(包含短板筛选规则信息)") @ApiOperation(value = "根据考核指标id获取指标详情(包含短板筛选规则信息)", notes = "根据考核指标id获取指标详情(包含短板筛选规则信息)")
@PostMapping(value = "/getDrivedefDetailById") @PostMapping(value = "/getDrivedefDetailById")
public Map<String,Object> getDrivedefDetailById(@RequestParam String indId) throws Exception{ public Map<String,Object> getDrivedefDetailById(@RequestParam String indId) throws Exception{
......
...@@ -21,8 +21,8 @@ public class BaseIndDef { ...@@ -21,8 +21,8 @@ public class BaseIndDef {
private String indDept;//数据项归属部门 private String indDept;//数据项归属部门
private String indUnit;//数据项单位 private String indUnit;//数据项单位
private String indDesc;//说明 private String indDesc;//说明
private String indSource;//数据项来源 private String indSource;//数据项来源 1:excel导入 2:手工填报
private String indFrequency;//数据源频度 private String indFrequency;//数据源频度 0:月度 1:季度 2:年度
private String creater; private String creater;
private Date createTime; private Date createTime;
private String updater; private String updater;
......
...@@ -28,7 +28,7 @@ public class DriveIndDef { ...@@ -28,7 +28,7 @@ public class DriveIndDef {
private Integer indCalScoreRule;//计分规则 private Integer indCalScoreRule;//计分规则
private String indCalScoreRuleDesc;//计分规则描述 private String indCalScoreRuleDesc;//计分规则描述
private String isUnitCalScore;//是否参与单位得分计算 是:1 否:0 private String isUnitCalScore;//是否参与单位得分计算 是:1 否:0
private String indFrequency;//指标频度 private String indFrequency;//指标频度 0:月度给数 1:季度给数 2:年度给数
private String version;//版本号 private String version;//版本号
private Integer catalogId;//挂靠目录id private Integer catalogId;//挂靠目录id
private String catalogIdPath;//挂靠目录idPath,方便用目录类别找到对应的挂靠指标 private String catalogIdPath;//挂靠目录idPath,方便用目录类别找到对应的挂靠指标
......
...@@ -16,7 +16,7 @@ public interface BaseIndDefMapper extends BaseMapper<BaseIndDef>{ ...@@ -16,7 +16,7 @@ public interface BaseIndDefMapper extends BaseMapper<BaseIndDef>{
public int getByKeywordCount(Map<String,Object> param); public int getByKeywordCount(Map<String,Object> param);
public void deleteByCatalogIdIn(List<Integer> catalogIds); public void deleteByCatalogIdIn(@Param("list")List<Integer> catalogIds);
public String getMaxIndId(@Param("code")String code,@Param("length")int length); public String getMaxIndId(@Param("code")String code,@Param("length")int length);
} }
...@@ -16,7 +16,9 @@ public interface DriveIndDefMapper extends BaseMapper<DriveIndDef>{ ...@@ -16,7 +16,9 @@ public interface DriveIndDefMapper extends BaseMapper<DriveIndDef>{
public int getByKeywordCount(Map<String,Object> param); public int getByKeywordCount(Map<String,Object> param);
public void deleteByCatalogIdIn(List<Integer> catalogIds); public void deleteByCatalogIdIn(@Param("list")List<Integer> catalogIds);
public String getMaxIndId(@Param("code")String code,@Param("length")int length); public String getMaxIndId(@Param("code")String code,@Param("length")int length);
public List<DriveIndDef> getByIdList(@Param("list")List<String> ids);
} }
...@@ -11,7 +11,7 @@ import feign.Param; ...@@ -11,7 +11,7 @@ import feign.Param;
import tk.mybatis.mapper.common.BaseMapper; import tk.mybatis.mapper.common.BaseMapper;
@Mapper @Mapper
public interface DriveIndCatalogMapper extends BaseMapper<DriveIndCatalog>{ public interface DriveIndCatalogMapper extends BaseMapper<DriveIndCatalog>{
public void deleteByIdIn(List<Integer> ids); public void deleteByIdIn(@Param("list")List<Integer> ids);
public List<DriveIndCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params); public List<DriveIndCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params);
......
...@@ -12,7 +12,7 @@ import tk.mybatis.mapper.common.BaseMapper; ...@@ -12,7 +12,7 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper @Mapper
public interface IndCatalogMapper extends BaseMapper<IndCatalog>{ public interface IndCatalogMapper extends BaseMapper<IndCatalog>{
public void deleteByIdIn(List<Integer> ids); public void deleteByIdIn(@Param("list")List<Integer> ids);
public List<IndCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params); public List<IndCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params);
......
...@@ -11,10 +11,12 @@ import tk.mybatis.mapper.common.BaseMapper; ...@@ -11,10 +11,12 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper @Mapper
public interface IndScorecardMapper extends BaseMapper<IndScorecard>{ public interface IndScorecardMapper extends BaseMapper<IndScorecard>{
public void deleteByCatalogIdIn(List<Integer> catalogIds); public void deleteByCatalogIdIn(@Param("list")List<Integer> catalogIds);
public List<IndScorecard> findByCatalogId(@Param("catalogId")Integer catalogId, public List<IndScorecard> findByCatalogId(@Param("catalogId")Integer catalogId,
@Param("start") int start,@Param("end") int end); @Param("start") int start,@Param("end") int end);
public int countByCatalogId(@Param("catalogId")Integer catalogId); public int countByCatalogId(@Param("catalogId")Integer catalogId);
public List<IndScorecard> findByIdList(@Param("list")List<Integer> ids);
} }
...@@ -12,7 +12,7 @@ import tk.mybatis.mapper.common.BaseMapper; ...@@ -12,7 +12,7 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper @Mapper
public interface ScoreRuleCatalogMapper extends BaseMapper<ScoreRuleCatalog>{ public interface ScoreRuleCatalogMapper extends BaseMapper<ScoreRuleCatalog>{
public void deleteByIdIn(List<Integer> ids); public void deleteByIdIn(@Param("list")List<Integer> ids);
public List<ScoreRuleCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params); public List<ScoreRuleCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params);
......
...@@ -13,7 +13,7 @@ import tk.mybatis.mapper.common.BaseMapper; ...@@ -13,7 +13,7 @@ import tk.mybatis.mapper.common.BaseMapper;
public interface ScoreRuleMapper extends BaseMapper<ScoreRule>{ public interface ScoreRuleMapper extends BaseMapper<ScoreRule>{
public List<ScoreRule> findByCode(@Param("code")String code); public List<ScoreRule> findByCode(@Param("code")String code);
public void deleteByCatalogIdIn(List<Integer> ids); public void deleteByCatalogIdIn(@Param("list")List<Integer> ids);
public List<ScoreRule> findByCatalogId(@Param("catalogId")Integer catalogId, public List<ScoreRule> findByCatalogId(@Param("catalogId")Integer catalogId,
@Param("start") int start,@Param("end") int end); @Param("start") int start,@Param("end") int end);
......
...@@ -12,7 +12,7 @@ import tk.mybatis.mapper.common.BaseMapper; ...@@ -12,7 +12,7 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper @Mapper
public interface ScorecardCatalogMapper extends BaseMapper<ScorecardCatalog>{ public interface ScorecardCatalogMapper extends BaseMapper<ScorecardCatalog>{
public void deleteByIdIn(List<Integer> ids); public void deleteByIdIn(@Param("list")List<Integer> ids);
public List<ScorecardCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params); public List<ScorecardCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params);
......
...@@ -11,7 +11,7 @@ import tk.mybatis.mapper.common.BaseMapper; ...@@ -11,7 +11,7 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper @Mapper
public interface ShortboardCatalogMapper extends BaseMapper<ShortboardCatalog>{ public interface ShortboardCatalogMapper extends BaseMapper<ShortboardCatalog>{
public void deleteByIdIn(List<Integer> ids); public void deleteByIdIn(@Param("list")List<Integer> ids);
public List<ShortboardCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params); public List<ShortboardCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params);
......
...@@ -11,7 +11,7 @@ import tk.mybatis.mapper.common.BaseMapper; ...@@ -11,7 +11,7 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper @Mapper
public interface ShortboardRuleMapper extends BaseMapper<ShortboardRule>{ public interface ShortboardRuleMapper extends BaseMapper<ShortboardRule>{
public void deleteByCatalogIdIn(List<Integer> ids); public void deleteByCatalogIdIn(@Param("list")List<Integer> ids);
public List<ShortboardRule> findByCatalogId(@Param("catalogId")Integer catalogId, public List<ShortboardRule> findByCatalogId(@Param("catalogId")Integer catalogId,
@Param("start") int start,@Param("end") int end); @Param("start") int start,@Param("end") int end);
......
...@@ -12,7 +12,7 @@ import tk.mybatis.mapper.common.BaseMapper; ...@@ -12,7 +12,7 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper @Mapper
public interface ShortboardUnitCatalogMapper extends BaseMapper<ShortboardUnitCatalog>{ public interface ShortboardUnitCatalogMapper extends BaseMapper<ShortboardUnitCatalog>{
public void deleteByIdIn(List<Integer> ids); public void deleteByIdIn(@Param("list")List<Integer> ids);
public List<ShortboardUnitCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params); public List<ShortboardUnitCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params);
......
...@@ -11,7 +11,7 @@ import tk.mybatis.mapper.common.BaseMapper; ...@@ -11,7 +11,7 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper @Mapper
public interface ShortboardUnitMapper extends BaseMapper<ShortboardUnit>{ public interface ShortboardUnitMapper extends BaseMapper<ShortboardUnit>{
public void deleteByCatalogIdIn(List<Integer> ids); public void deleteByCatalogIdIn(@Param("list")List<Integer> ids);
public List<ShortboardUnit> findByCatalogId(@Param("catalogId")Integer catalogId, public List<ShortboardUnit> findByCatalogId(@Param("catalogId")Integer catalogId,
@Param("start") int start,@Param("end") int end); @Param("start") int start,@Param("end") int end);
......
...@@ -103,6 +103,10 @@ public class DriveIndDefService { ...@@ -103,6 +103,10 @@ public class DriveIndDefService {
return driveIndDefMapper.selectOne(driveIndDef); return driveIndDefMapper.selectOne(driveIndDef);
} }
public List<DriveIndDef> getByIdList(List<String> ids) throws Exception{
return driveIndDefMapper.getByIdList(ids);
}
public Map<String,Object> getDetailById(String indId) throws Exception{ public Map<String,Object> getDetailById(String indId) throws Exception{
Map<String,Object> result = new HashMap<>(); Map<String,Object> result = new HashMap<>();
DriveIndDef driveIndDef = new DriveIndDef(); DriveIndDef driveIndDef = new DriveIndDef();
......
...@@ -88,6 +88,10 @@ public class IndScorecardService { ...@@ -88,6 +88,10 @@ public class IndScorecardService {
return null; return null;
} }
public List<IndScorecard> findByIdList(List<Integer> ids) throws Exception{
return indScorecardMapper.findByIdList(ids);
}
public Map<String,Object> getByCatalogId(Integer catalogId,int page,int rows){ public Map<String,Object> getByCatalogId(Integer catalogId,int page,int rows){
Map<String,Object> result = new HashMap<>(); Map<String,Object> result = new HashMap<>();
int count = 0; int count = 0;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
delete delete
from base_ind_def from base_ind_def
where catalog_id in where catalog_id in
<foreach item="id" collection="catalogIds" open="(" close=")" separator=","> <foreach item="id" collection="list" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
delete delete
from drive_ind_catalog from drive_ind_catalog
where id in where id in
<foreach item="id" collection="ids" open="(" close=")" separator=","> <foreach item="id" collection="list" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
delete delete
from drive_ind_def from drive_ind_def
where catalog_id in where catalog_id in
<foreach item="id" collection="catalogIds" open="(" close=")" separator=","> <foreach item="id" collection="list" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
...@@ -40,4 +40,13 @@ ...@@ -40,4 +40,13 @@
from drive_ind_def from drive_ind_def
where ind_id like #{code} and LENGTH(ind_id)=#{length}; where ind_id like #{code} and LENGTH(ind_id)=#{length};
</select> </select>
<select id="getByIdList" parameterType="java.util.List" resultType="com.keymobile.indicators.model.entity.indicators.DriveIndDef">
select *
from drive_ind_def
where ind_id in
<foreach item="id" collection="list" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
delete delete
from base_ind_catalog from base_ind_catalog
where id in where id in
<foreach item="id" collection="ids" open="(" close=")" separator=","> <foreach item="id" collection="list" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
......
...@@ -18,8 +18,17 @@ ...@@ -18,8 +18,17 @@
delete delete
from drive_ind_score_card from drive_ind_score_card
where catalog_id in where catalog_id in
<foreach item="id" collection="catalogIds" open="(" close=")" separator=","> <foreach item="id" collection="list" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="findByIdList" parameterType="java.util.List" resultType="com.keymobile.indicators.model.entity.scorecard.IndScorecard">
select *
from drive_ind_score_card
where id in
<foreach item="id" collection="list" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
delete delete
from obj_score_rule_catalog from obj_score_rule_catalog
where id in where id in
<foreach item="id" collection="ids" open="(" close=")" separator=","> <foreach item="id" collection="list" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
delete delete
from obj_score_rule from obj_score_rule
where catalog_id in where catalog_id in
<foreach item="id" collection="catalogIds" open="(" close=")" separator=","> <foreach item="id" collection="list" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
delete delete
from score_card_catalog from score_card_catalog
where id in where id in
<foreach item="id" collection="ids" open="(" close=")" separator=","> <foreach item="id" collection="list" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
delete delete
from ind_short_board_catalog from ind_short_board_catalog
where id in where id in
<foreach item="id" collection="ids" open="(" close=")" separator=","> <foreach item="id" collection="list" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
delete delete
from short_board_rule from short_board_rule
where catalog_id in where catalog_id in
<foreach item="id" collection="catalogIds" open="(" close=")" separator=","> <foreach item="id" collection="list" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
delete delete
from short_board_unit_catalog from short_board_unit_catalog
where id in where id in
<foreach item="id" collection="ids" open="(" close=")" separator=","> <foreach item="id" collection="list" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
delete delete
from short_board_unit from short_board_unit
where catalog_id in where catalog_id in
<foreach item="id" collection="catalogIds" open="(" close=")" separator=","> <foreach item="id" collection="list" open="(" close=")" separator=",">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
......
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