浏览代码

团队模板全表模糊搜索

wujunjie 7 年之前
父节点
当前提交
0b18089083

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorTeamGuidanceTemplateDao.java

@ -49,7 +49,7 @@ public interface DoctorTeamGuidanceTemplateDao extends PagingAndSortingRepositor
    // 根据模板文章标题模糊搜索团队指导模板
    @Query("SELECT b FROM DoctorTeamGuidanceDetail a, DoctorTeamGuidanceTemplate b WHERE a.code = b.teamTemplateCode  " +
            " AND b.del = 1 AND b.teamId = ?1 AND b.title LIKE ?2 order by b.useTimes desc  ")
    Page<DoctorTeamGuidanceTemplate> listByTile(int teamId, String owner, Pageable pageRequest);
            " AND b.del = 1 AND b.title LIKE ?1 order by b.useTimes desc  ")
    Page<DoctorTeamGuidanceTemplate> listByTile(String title, Pageable pageRequest);
}

+ 4 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorGuidanceTempService.java

@ -261,7 +261,7 @@ public class DoctorGuidanceTempService extends BaseService {
     * @return
     * @throws Exception
     */
    public List<Map<String, Object>> listByTitle(String filter,String type, Integer teamId, int pageSize, int pageNo) throws Exception {
    public List<Map<String, Object>> listByTitle(String filter,String type, int pageSize, int pageNo) throws Exception {
        PageRequest pageRequest = new PageRequest(pageNo, pageSize);
        List<Map<String, Object>> listMap = new ArrayList<>();
@ -293,14 +293,15 @@ public class DoctorGuidanceTempService extends BaseService {
                tem.put("modelName", dgt.getModelName());
                listMap.add(tem);
            }
        } else if("3".equals(type) && teamId!=null){
            Page<DoctorTeamGuidanceTemplate> temps = doctorTeamGuidanceTemplateDao.listByTile(teamId,"%"+filter+"%", pageRequest);
        } else if("3".equals(type)){
            Page<DoctorTeamGuidanceTemplate> temps = doctorTeamGuidanceTemplateDao.listByTile("%"+filter+"%", pageRequest);
            List<DoctorTeamGuidanceTemplate> list = temps.getContent();
            for (int i = 0; i < list.size(); i++) {
                DoctorTeamGuidanceTemplate dgt = list.get(i);
                Map<String, Object> tem = new HashMap<>();
                tem.put("teamId", dgt.getTeamId());
                tem.put("teamName", dgt.getTeamName());
                tem.put("code", dgt.getTeamTemplateCode());
                tem.put("owner", dgt.getCreater());
                tem.put("sendTimes", dgt.getUseTimes());

+ 1 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempController.java

@ -207,8 +207,6 @@ public class DoctorGuidanceTempController extends BaseController {
                        @ApiParam(value = "搜索关键字") String filter,
                        @RequestParam(required = true, defaultValue = "")
                        @ApiParam(value = "模板类型 1:系统 2:个人 3:团队摸版") String type,
                        @RequestParam(required = false)
                        @ApiParam(value = "3:团队摸版时 团队ID") Integer teamId,
                        @RequestParam(defaultValue = "10")
                        @ApiParam(value = "页展示数量") String pageSize,
                        @RequestParam(defaultValue = "1") @ApiParam(value = "当前页码") String pageNo) {
@ -217,7 +215,7 @@ public class DoctorGuidanceTempController extends BaseController {
            int pageno = Integer.parseInt(pageNo) - 1;
            List<Map<String, Object>> temps = null;
            if (StringUtils.isNotEmpty(type) && StringUtils.isNotEmpty(filter)){
                temps = guidanceTempService.listByTitle(filter,type,teamId,pagesize, pageno);
                temps = guidanceTempService.listByTitle(filter,type,pagesize, pageno);
            }else {
                return error(-1, "模板类型不能为空!");
            }