Commit 69661ba7 by zhangkb

各种类型目录接口添加关键字查询接口

parent 84833a54
package com.keymobile.indicators.api.hytobacco;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -47,6 +49,16 @@ public class IndScorecardCtrl {
return scorecardCatalogService.getCatalog(parentId, codes);
}
@ApiOperation(value = "根据关键字查询评分卡目录", notes = "根据关键字查询评分卡目录")
@PostMapping(value = "/getCatalogByKeyword")
public List<ScorecardCatalog> getCatalogByKeyword(@RequestParam(required=false) String keyword,
@RequestParam List<String> codes){
if(StringUtils.isBlank(keyword)) {
return new ArrayList<>();
}
return scorecardCatalogService.getCatalogByKeyword(keyword, codes);
}
@ApiOperation(value = "新增/修改", notes = "新增/修改")
@PostMapping(value = "/saveOrUpdate")
public Integer saveOrUpdate(@RequestBody IndScorecard indScorecard,@RequestParam Integer catalogId,
......
package com.keymobile.indicators.api.hytobacco;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -47,6 +49,16 @@ public class ObjScoreRuleCtrl {
return scoreRuleCatalogService.getCatalog(parentId, codes);
}
@ApiOperation(value = "根据关键字搜索单位规则目录", notes = "根据关键字搜索单位规则目录")
@PostMapping(value = "/getCatalogByKeyword")
public List<ScoreRuleCatalog> getCatalogByKeyword(@RequestParam(required=false) String keyword,
@RequestParam List<String> codes){
if(StringUtils.isBlank(keyword)) {
return new ArrayList<>();
}
return scoreRuleCatalogService.getCatalogByKeyword(keyword, codes);
}
@ApiOperation(value = "新增/修改", notes = "新增/修改")
@PostMapping(value = "/saveOrUpdate")
public Integer saveOrUpdate(@RequestBody ScoreRule scoreRule,@RequestParam Integer catalogId,
......
package com.keymobile.indicators.api.hytobacco;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -47,6 +49,16 @@ public class ShortboardRuleCtrl {
return shortboardCatalogService.getCatalog(parentId, codes);
}
@ApiOperation(value = "根据关键字搜索短板筛选规则目录", notes = "根据关键字搜索短板筛选规则目录")
@PostMapping(value = "/getCatalogByKeyword")
public List<ShortboardCatalog> getCatalogByKeyword(@RequestParam(required=false) String keyword,
@RequestParam List<String> codes){
if(StringUtils.isBlank(keyword)) {
return new ArrayList<>();
}
return shortboardCatalogService.getCatalogByKeyword(keyword, codes);
}
@ApiOperation(value = "新增/修改", notes = "新增/修改")
@PostMapping(value = "/saveOrUpdate")
public Integer saveOrUpdate(@RequestBody ShortboardRule shortboardRule,@RequestParam Integer catalogId,
......
package com.keymobile.indicators.api.hytobacco;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -50,6 +52,16 @@ public class ShortboardUnitCtrl {
return shortboardUnitCatalogService.getCatalog(parentId, codes);
}
@ApiOperation(value = "根据关键字搜索短板筛选规则目录", notes = "根据关键字搜索短板筛选规则目录")
@PostMapping(value = "/getCatalogByKeyword")
public List<ShortboardUnitCatalog> getCatalogByKeyword(@RequestParam(required=false) String keyword,
@RequestParam List<String> codes){
if(StringUtils.isBlank(keyword)) {
return new ArrayList<>();
}
return shortboardUnitCatalogService.getCatalogByKeyword(keyword, codes);
}
@ApiOperation(value = "新增/修改", notes = "新增/修改")
@PostMapping(value = "/saveOrUpdate")
public Integer saveOrUpdate(@RequestBody ShortboardUnit shortboardUnit,@RequestParam Integer catalogId,
......
......@@ -16,4 +16,6 @@ public interface ScoreRuleCatalogMapper extends BaseMapper<ScoreRuleCatalog>{
public List<ScoreRuleCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params);
public List<ScoreRuleCatalog> findByParentId(@Param("pid") Integer pid);
public List<ScoreRuleCatalog> findByKeyword(Map<String,Object> params);
}
......@@ -16,4 +16,6 @@ public interface ScorecardCatalogMapper extends BaseMapper<ScorecardCatalog>{
public List<ScorecardCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params);
public List<ScorecardCatalog> findByParentId(@Param("pid") Integer pid);
public List<ScorecardCatalog> findByKeyword(Map<String,Object> params);
}
......@@ -16,4 +16,6 @@ public interface ShortboardCatalogMapper extends BaseMapper<ShortboardCatalog>{
public List<ShortboardCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params);
public List<ShortboardCatalog> findByParentId(@Param("pid") Integer pid);
public List<ShortboardCatalog> findByKeyword(Map<String,Object> params);
}
......@@ -16,4 +16,6 @@ public interface ShortboardUnitCatalogMapper extends BaseMapper<ShortboardUnitCa
public List<ShortboardUnitCatalog> findByParentIdAndCodeInOrderByLastUpdateTimeDesc(Map<String,Object> params);
public List<ShortboardUnitCatalog> findByParentId(@Param("pid") Integer pid);
public List<ShortboardUnitCatalog> findByKeyword(Map<String,Object> params);
}
......@@ -81,4 +81,12 @@ public class ScoreRuleCatalogService {
paramMap.put("codes", codes);
return scoreRuleCatalogMapper.findByParentIdAndCodeInOrderByLastUpdateTimeDesc(paramMap);
}
//根据关键字搜索目录树
public List<ScoreRuleCatalog> getCatalogByKeyword(String keyword,List<String> codes){
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("keyword", "%"+keyword+"%");
paramMap.put("codes", codes);
return scoreRuleCatalogMapper.findByKeyword(paramMap);
}
}
......@@ -81,4 +81,12 @@ public class ScorecardCatalogService {
paramMap.put("codes", codes);
return scorecardCatalogMapper.findByParentIdAndCodeInOrderByLastUpdateTimeDesc(paramMap);
}
//根据关键字获取目录树节点
public List<ScorecardCatalog> getCatalogByKeyword(String keyword,List<String> codes){
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("keyword", "%"+keyword+"%");
paramMap.put("codes", codes);
return scorecardCatalogMapper.findByKeyword(paramMap);
}
}
......@@ -80,4 +80,12 @@ public class ShortboardCatalogService {
paramMap.put("codes", codes);
return shortboardCatalogMapper.findByParentIdAndCodeInOrderByLastUpdateTimeDesc(paramMap);
}
//根据关键字搜索目录树
public List<ShortboardCatalog> getCatalogByKeyword(String keyword,List<String> codes){
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("keyword", "%"+keyword+"%");
paramMap.put("codes", codes);
return shortboardCatalogMapper.findByKeyword(paramMap);
}
}
......@@ -81,4 +81,12 @@ public class ShortboardUnitCatalogService {
paramMap.put("codes", codes);
return shortboardUnitCatalogMapper.findByParentIdAndCodeInOrderByLastUpdateTimeDesc(paramMap);
}
//根据关键字获取目录树
public List<ShortboardUnitCatalog> getCatalogByKeyword(String keyword,List<String> codes){
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("keyword", "%"+keyword+"%");
paramMap.put("codes", codes);
return shortboardUnitCatalogMapper.findByKeyword(paramMap);
}
}
......@@ -26,4 +26,14 @@
from obj_score_rule_catalog
where parent_id = #{pid}
</select>
<select id="findByKeyword" parameterType="map" resultType="com.keymobile.indicators.model.entity.objscorerule.ScoreRuleCatalog" >
select *
from obj_score_rule_catalog
where catalog_name like #{keyword} and
code in
<foreach item="id" collection="codes" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
</mapper>
\ No newline at end of file
......@@ -26,4 +26,14 @@
from score_card_catalog
where parent_id = #{pid}
</select>
<select id="findByKeyword" parameterType="map" resultType="com.keymobile.indicators.model.entity.scorecard.ScorecardCatalog" >
select *
from score_card_catalog
where catalog_name like #{keyword} and
code in
<foreach item="id" collection="codes" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
</mapper>
\ No newline at end of file
......@@ -26,4 +26,14 @@
from ind_short_board_catalog
where parent_id = #{pid}
</select>
<select id="findByKeyword" parameterType="map" resultType="com.keymobile.indicators.model.entity.shortboard.ShortboardCatalog" >
select *
from ind_short_board_catalog
where catalog_name like #{keyword} and
code in
<foreach item="id" collection="codes" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
</mapper>
\ No newline at end of file
......@@ -26,4 +26,14 @@
from short_board_unit_catalog
where parent_id = #{pid}
</select>
<select id="findByKeyword" parameterType="map" resultType="com.keymobile.indicators.model.entity.shortboard.ShortboardUnitCatalog" >
select *
from short_board_unit_catalog
where catalog_name like #{keyword} and
code in
<foreach item="id" collection="codes" open="(" close=")" separator=",">
#{id}
</foreach>
</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