|
@@ -54,53 +54,6 @@ public class SceneProvider {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public String searchUnion2(ScenePageDto param){
|
|
|
- // type=building、garden ,查scene_title
|
|
|
- StringBuffer sql = new StringBuffer("select * from tb_scene where is_delete = 0 and (type='building' or type='garden')");
|
|
|
-
|
|
|
- String houseId = param.getHouseId();
|
|
|
- if(!StringUtils.isAllBlank(houseId)){
|
|
|
- sql.append(" and house_id = '").append(houseId).append("'");
|
|
|
- }
|
|
|
-
|
|
|
- String status = param.getStatus();
|
|
|
- // 传3 过来,会把审核:4、未审核:3的都传给前端
|
|
|
- if(StringUtils.isNotBlank(status)){
|
|
|
- sql.append(" and status >= '").append(status).append("'");
|
|
|
- }
|
|
|
-
|
|
|
- String searchKey = param.getSearchKey();
|
|
|
- if(!StringUtils.isAllBlank(searchKey)){
|
|
|
- sql.append(" and (");
|
|
|
- sql.append(" scene_title like '%").append(searchKey).append("%'");
|
|
|
-// sql.append(" or room_name like '%").append(searchKey).append("%'");
|
|
|
- sql.append( ")");
|
|
|
- }
|
|
|
-
|
|
|
- // UNION
|
|
|
- // type=house ,查询room_name
|
|
|
- sql.append(" UNION select * from tb_scene where is_delete = 0 and type='house'");
|
|
|
- if(!StringUtils.isAllBlank(houseId)){
|
|
|
- sql.append(" and house_id = '").append(houseId).append("'");
|
|
|
- }
|
|
|
-
|
|
|
- if(StringUtils.isNotBlank(status)){
|
|
|
- sql.append(" and status >= '").append(status).append("'");
|
|
|
- }
|
|
|
-
|
|
|
- if(!StringUtils.isAllBlank(searchKey)){
|
|
|
- sql.append(" and (");
|
|
|
- sql.append(" room_name like '%").append(searchKey).append("%'");
|
|
|
- sql.append( ")");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- sql.append(" order by sort asc, create_time asc");
|
|
|
-
|
|
|
- log.info("sql: {}", sql.toString());
|
|
|
- return sql.toString();
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 根据不同类型模糊查询不同字段
|
|
|
* @param param
|
|
@@ -125,7 +78,6 @@ public class SceneProvider {
|
|
|
if(!StringUtils.isAllBlank(searchKey)){
|
|
|
sql.append(" and (");
|
|
|
sql.append(" scene_title like '%").append(searchKey).append("%'");
|
|
|
-// sql.append(" or room_name like '%").append(searchKey).append("%'");
|
|
|
sql.append( ")");
|
|
|
}
|
|
|
|