|
@@ -22,13 +22,23 @@ 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( ")");
|
|
|
}
|
|
|
|
|
|
String type = param.getType();
|
|
|
if(!StringUtils.isAllBlank(type)){
|
|
|
- sql.append(" and ( type = '").append(type).append("' )");
|
|
|
+ // 园林全景需要把by_type=garden的模型数据展现到园林全景
|
|
|
+ if (type.equals("garden")) {
|
|
|
+ sql.append(" and (");
|
|
|
+ sql.append(" type = '").append(type).append("'");
|
|
|
+ sql.append(" or by_type = '").append(type).append("'");
|
|
|
+ sql.append( ")");
|
|
|
+ } else if (type.equals("house")) {
|
|
|
+ sql.append(" and type = '").append(type).append("'");
|
|
|
+ sql.append(" and by_type = '0'");
|
|
|
+ } else {
|
|
|
+ sql.append(" and type = '").append(type).append("'");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
String status = param.getStatus();
|
|
@@ -44,7 +54,7 @@ public class SceneProvider {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public String searchUnion(ScenePageDto param){
|
|
|
+ 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')");
|
|
|
|
|
@@ -67,13 +77,61 @@ public class SceneProvider {
|
|
|
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
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String searchUnion(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' ");
|
|
|
+ sql.append(" UNION select * from tb_scene where is_delete = 0 and type='house' and by_type='0'");
|
|
|
if(!StringUtils.isAllBlank(houseId)){
|
|
|
sql.append(" and house_id = '").append(houseId).append("'");
|
|
|
}
|
|
@@ -88,6 +146,22 @@ public class SceneProvider {
|
|
|
sql.append( ")");
|
|
|
}
|
|
|
|
|
|
+ // 园林全景-模型, 使用scene_title 搜索
|
|
|
+ sql.append(" UNION select * from tb_scene where is_delete = 0 and type='house' and by_type='garden'");
|
|
|
+ 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(" scene_title like '%").append(searchKey).append("%'");
|
|
|
+ sql.append( ")");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
sql.append(" order by sort asc, create_time asc");
|
|
|
|