Commit fce5c095 authored by 赵灿灿's avatar 赵灿灿

修改查询条件

parent 0af64ced
Pipeline #21467 passed with stages
in 4 minutes and 11 seconds
...@@ -600,6 +600,8 @@ public class ExpertInformationCriteria extends AbstractCriteria { ...@@ -600,6 +600,8 @@ public class ExpertInformationCriteria extends AbstractCriteria {
} }
//endregion //endregion
//region 所属地市模糊查询 //region 所属地市模糊查询
public boolean byRegionCodeContain() { public boolean byRegionCodeContain() {
return this.andMap.containsKey("RegionCodeContain"); return this.andMap.containsKey("RegionCodeContain");
...@@ -619,4 +621,24 @@ public class ExpertInformationCriteria extends AbstractCriteria { ...@@ -619,4 +621,24 @@ public class ExpertInformationCriteria extends AbstractCriteria {
} }
//endregion //endregion
//region 所属地市名称模糊查询
public boolean byRegionNameContain() {
return this.andMap.containsKey("RegionNameContain");
}
private String regionNameContain;
public String getRegionNameContain() {
if (byRegionNameContain())
return regionNameContain;
return null;
}
public void setRegionNameContain(String value) {
this.regionNameContain = value;
this.andMap.put("RegionNameContain", value);
}
//endregion
} }
\ No newline at end of file
...@@ -87,7 +87,7 @@ public class ExpertInformationService { ...@@ -87,7 +87,7 @@ public class ExpertInformationService {
public Map<String, Object> selectExpertInformation( ExpertInformationCriteria criteria) { public Map<String, Object> selectExpertInformation( ExpertInformationCriteria criteria) {
try { try {
criteria.removeMapNullOrEmpty(); criteria.removeMapNullOrEmpty();
List<ExpertInformation> entityList = repository.selectByCriteria(criteria); List<Map<String,Object>> entityList = repository.selectExpertByPage(criteria,1,10);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("entityList", entityList); map.put("entityList", entityList);
return map; return map;
......
package com.infoepoch.pms.dispatchassistant.domain.expertInformation; package com.infoepoch.pms.dispatchassistant.domain.expertInformation;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* generated by code-generator * generated by code-generator
...@@ -68,6 +69,11 @@ public interface IExpertInformationRepository { ...@@ -68,6 +69,11 @@ public interface IExpertInformationRepository {
*/ */
List<ExpertInformation> selectCriteriaByPage(ExpertInformationCriteria criteria, int pageNum, int pageSize); List<ExpertInformation> selectCriteriaByPage(ExpertInformationCriteria criteria, int pageNum, int pageSize);
/**
* 根据查询条件分页查询对象结合
* @param: [criteria, pageNum, pageSize]
*/
List<Map<String,Object>> selectExpertByPage(ExpertInformationCriteria criteria, int pageNum, int pageSize);
/** /**
* 根据条件查询对象总记录数 * 根据条件查询对象总记录数
* @param: [criteria] * @param: [criteria]
......
...@@ -242,6 +242,35 @@ public class ExpertInformationRepository implements IExpertInformationRepository ...@@ -242,6 +242,35 @@ public class ExpertInformationRepository implements IExpertInformationRepository
} }
} }
/**
* 根据查询条件分页查询对象结合
*/
@Override
public List<Map<String,Object>> selectExpertByPage(ExpertInformationCriteria criteria, int pageNum, int pageSize) {
StringBuffer buffer = new StringBuffer("SELECT EI_NAME 姓名, ( case when EI_GENDER ='1' then\n" +
" '男'\n" +
" else\n" +
" '女'\n" +
" end) 专家性别,\n" +
"EI_MAILBOX 专家邮箱,EI_TELEPHONE 专家电话,EI_DEPARTMENT 专家部门,EI_GROUP 专家科室,\n" +
"EI_POSITION 职位,EI_SCOPE_BUSINESS 业务范围,EI_SPECIALIZES_FIELDS 擅长领域,\n" +
"EI_EXPERT_INTRODUCTION 专家简介,region_name 所属地市 \n" +
" FROM T_EXPERT_INFORMATION left join (select ed_region_code,region_name from (\n" +
"select ( case when ed_region_code =1 then\n" +
" '省本部'\n" +
" else\n" +
" ed_dep_org_name\n" +
" end) region_name,ed_region_code from T_expert_dep\n" +
")group by ed_region_code,region_name) a on a.ed_region_code=EI_REGION_CODE ");
List<Object> list = OracleUtils.combinationSql(buffer, createCriteriaSql(criteria), pageNum, pageSize,"EI_ID");
try {
return jdbcTemplate.queryForList(buffer.toString(), list.toArray());
} catch (Exception e) {
LogHelper.info(e.getMessage());
return null;
}
}
/** /**
* 根据条件查询对象总记录数 * 根据条件查询对象总记录数
*/ */
...@@ -393,6 +422,9 @@ public class ExpertInformationRepository implements IExpertInformationRepository ...@@ -393,6 +422,9 @@ public class ExpertInformationRepository implements IExpertInformationRepository
//所属地市(LIKE) //所属地市(LIKE)
if (criteria.byRegionCodeContain()) if (criteria.byRegionCodeContain())
andMap.put(" EI_REGION_CODE LIKE ? ", "%" + criteria.getRegionCodeContain() + "%"); andMap.put(" EI_REGION_CODE LIKE ? ", "%" + criteria.getRegionCodeContain() + "%");
//所属地市(LIKE)
if (criteria.byRegionNameContain())
andMap.put(" region_name LIKE ? ", "%" + criteria.getRegionNameContain() + "%");
return andMap; return andMap;
} }
......
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