Browse Source

修复动态where查询的bug

liu 2 years ago
parent
commit
608dfeca2e
33 changed files with 228 additions and 54 deletions
  1. 8 0
      .idea/.gitignore
  2. 19 0
      .idea/compiler.xml
  3. 6 0
      .idea/encodings.xml
  4. 20 0
      .idea/jarRepositories.xml
  5. 12 0
      .idea/misc.xml
  6. 124 0
      .idea/uiDesigner.xml
  7. 6 0
      .idea/vcs.xml
  8. 1 1
      README.md
  9. 0 1
      src/main/java/com/template/api/HouseAPI.java
  10. 0 1
      src/main/java/com/template/controller/HouseController.java
  11. 0 1
      src/main/java/com/template/controller/HousePriceController.java
  12. 1 1
      src/main/java/com/template/mapper/HouseNumberMapper.java
  13. 1 1
      src/main/java/com/template/mapper/HousePriceMapper.java
  14. 5 4
      src/main/java/com/template/model/pojo/House.java
  15. 5 4
      src/main/java/com/template/model/pojo/HouseNumber.java
  16. 5 5
      src/main/java/com/template/model/pojo/HousePrice.java
  17. 0 1
      src/main/java/com/template/model/vo/HousedetailsVo.java
  18. 1 1
      src/main/java/com/template/services/HouseNumberService.java
  19. 1 1
      src/main/java/com/template/services/HousePriceService.java
  20. 1 1
      src/main/java/com/template/services/HouseService.java
  21. 1 1
      src/main/java/com/template/services/impl/HouseNumberServiceImpl.java
  22. 1 2
      src/main/java/com/template/services/impl/HousePriceServiceImpl.java
  23. 2 3
      src/main/resources/mapper/template/HouseMapper.xml
  24. 3 11
      src/main/resources/mapper/template/HousePriceMapper.xml
  25. BIN
      target/classes/com/template/controller/HouseController.class
  26. BIN
      target/classes/com/template/controller/HousePriceController.class
  27. BIN
      target/classes/com/template/model/pojo/House.class
  28. BIN
      target/classes/com/template/model/pojo/HouseNumber.class
  29. BIN
      target/classes/com/template/model/pojo/HousePrice.class
  30. BIN
      target/classes/com/template/model/vo/HousedetailsVo.class
  31. BIN
      target/classes/com/template/services/impl/HousePriceServiceImpl.class
  32. 2 3
      target/classes/mapper/template/HouseMapper.xml
  33. 3 11
      target/classes/mapper/template/HousePriceMapper.xml

+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 19 - 0
.idea/compiler.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <profile default="true" name="Default" enabled="true" />
+      <profile name="Maven default annotation processors profile" enabled="true">
+        <sourceOutputDir name="target/generated-sources/annotations" />
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
+        <outputRelativeToContentRoot value="true" />
+        <module name="mybatis_plus" />
+      </profile>
+    </annotationProcessing>
+  </component>
+  <component name="JavacSettings">
+    <option name="ADDITIONAL_OPTIONS_OVERRIDE">
+      <module name="mybatis_plus" options="-parameters" />
+    </option>
+  </component>
+</project>

+ 6 - 0
.idea/encodings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
+  </component>
+</project>

+ 20 - 0
.idea/jarRepositories.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Central Repository" />
+      <option name="url" value="http://maven.aliyun.com/nexus/content/repositories/central/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+  </component>
+</project>

+ 12 - 0
.idea/misc.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="MavenProjectsManager">
+    <option name="originalFiles">
+      <list>
+        <option value="$PROJECT_DIR$/pom.xml" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
+</project>

+ 124 - 0
.idea/uiDesigner.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Palette2">
+    <group name="Swing">
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+      </item>
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+        <initial-values>
+          <property name="text" value="Button" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="RadioButton" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="CheckBox" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="Label" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
+    </group>
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

+ 1 - 1
README.md

@@ -1 +1 @@
-#iHotel_student_houtai
+#Back-endDevelopmentFramework

+ 0 - 1
src/main/java/com/template/api/HouseAPI.java

@@ -1,7 +1,6 @@
 package com.template.api;
 
 import com.template.model.dto.HouseDto;
-import com.template.model.pojo.House;
 import com.template.model.result.CommonResult;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.GetMapping;

+ 0 - 1
src/main/java/com/template/controller/HouseController.java

@@ -1,7 +1,6 @@
 package com.template.controller;
 
 
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.template.annotation.Encrypt;

+ 0 - 1
src/main/java/com/template/controller/HousePriceController.java

@@ -12,7 +12,6 @@ import com.template.model.pojo.PermissionSetting;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
 import com.template.model.vo.AlterPriceRecordVo;
-import com.template.model.vo.HouseVo;
 import com.template.model.vo.RoomTypeVo;
 import com.template.services.HousePriceService;
 import com.template.services.HouseService;

+ 1 - 1
src/main/java/com/template/mapper/HouseNumberMapper.java

@@ -1,7 +1,7 @@
 package com.template.mapper;
 
-import com.template.model.pojo.HouseNumber;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.pojo.HouseNumber;
 import org.apache.ibatis.annotations.Mapper;
 
 /**

+ 1 - 1
src/main/java/com/template/mapper/HousePriceMapper.java

@@ -2,8 +2,8 @@ package com.template.mapper;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.template.model.pojo.HousePrice;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.pojo.HousePrice;
 import com.template.model.vo.AlterPriceRecordVo;
 import org.apache.ibatis.annotations.Mapper;
 

+ 5 - 4
src/main/java/com/template/model/pojo/House.java

@@ -21,7 +21,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author ceshi
- * @since 2023-11-06
+ * @since 2023-11-17
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -31,6 +31,7 @@ public class House implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    @ApiModelProperty(value = "房间表")
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
@@ -38,7 +39,7 @@ public class House implements Serializable {
     private String roomName;
 
     @ApiModelProperty(value = "房间类型(1:全日房,2:钟点房)")
-    private int roomType;
+    private Integer roomType;
 
     @ApiModelProperty(value = "房间单价")
     private BigDecimal roomPrice;
@@ -52,7 +53,7 @@ public class House implements Serializable {
     @ApiModelProperty(value = "居住时长(状态为钟点房时才有)")
     private String roomLiveTime;
 
-    @ApiModelProperty(value = "营业时间receiving_time")
+    @ApiModelProperty(value = "营业时间(状态为钟点房时才有)")
     private String receivingTime;
 
     @ApiModelProperty(value = "可见类型(0:全部,1:学生,2:教职工,3:校友,4:访客,5:临时人员,6:其他,7:领导)")
@@ -82,7 +83,7 @@ public class House implements Serializable {
 
     @ApiModelProperty(value = "逻辑删除 未删除:0;删除:1")
     @TableField(fill = FieldFill.INSERT)
-    @TableLogic(value = "0", delval = "1")
+    @TableLogic
     private Integer deleted;
 
 

+ 5 - 4
src/main/java/com/template/model/pojo/HouseNumber.java

@@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author ceshi
- * @since 2023-11-09
+ * @since 2023-11-17
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -30,6 +30,7 @@ public class HouseNumber implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    @ApiModelProperty(value = "房间号表")
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
@@ -40,10 +41,10 @@ public class HouseNumber implements Serializable {
     private String roomNumber;
 
     @ApiModelProperty(value = "房间状态 1.净房 2.脏房")
-    private int  houseStatus;
+    private Integer houseStatus;
 
     @ApiModelProperty(value = "状态 1.空闲 2.正在使用")
-    private int status;
+    private Integer status;
 
     @ApiModelProperty(value = "电开关操作 1开电,2关电")
     private String electricType;
@@ -66,7 +67,7 @@ public class HouseNumber implements Serializable {
 
     @ApiModelProperty(value = "逻辑删除 未删除:0;删除:1")
     @TableField(fill = FieldFill.INSERT)
-    @TableLogic(value = "0", delval = "1")
+    @TableLogic
     private Integer deleted;
 
 

+ 5 - 5
src/main/java/com/template/model/pojo/HousePrice.java

@@ -1,10 +1,9 @@
 package com.template.model.pojo;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-
 import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
 import java.util.Date;
-
+import com.baomidou.mybatisplus.annotation.Version;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableLogic;
@@ -22,16 +21,17 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author ceshi
- * @since 2023-11-09
+ * @since 2023-11-17
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
-@ApiModel(value="HousePriceHistory对象", description="")
+@ApiModel(value="HousePrice对象", description="")
 public class HousePrice implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    @ApiModelProperty(value = "改价表")
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 

+ 0 - 1
src/main/java/com/template/model/vo/HousedetailsVo.java

@@ -1,6 +1,5 @@
 package com.template.model.vo;
 
-import com.template.model.pojo.House;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 

+ 1 - 1
src/main/java/com/template/services/HouseNumberService.java

@@ -1,7 +1,7 @@
 package com.template.services;
 
-import com.template.model.pojo.HouseNumber;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.template.model.pojo.HouseNumber;
 
 /**
  * <p>

+ 1 - 1
src/main/java/com/template/services/HousePriceService.java

@@ -1,7 +1,7 @@
 package com.template.services;
 
-import com.template.model.pojo.HousePrice;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.template.model.pojo.HousePrice;
 import com.template.model.result.PageUtils;
 import com.template.model.vo.AlterPriceRecordVo;
 

+ 1 - 1
src/main/java/com/template/services/HouseService.java

@@ -1,7 +1,7 @@
 package com.template.services;
 
-import com.template.model.pojo.House;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.template.model.pojo.House;
 import com.template.model.result.PageUtils;
 import com.template.model.vo.HouseVo;
 import com.template.model.vo.HousedetailsVo;

+ 1 - 1
src/main/java/com/template/services/impl/HouseNumberServiceImpl.java

@@ -1,7 +1,7 @@
 package com.template.services.impl;
 
-import com.template.model.pojo.HouseNumber;
 import com.template.mapper.HouseNumberMapper;
+import com.template.model.pojo.HouseNumber;
 import com.template.services.HouseNumberService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;

+ 1 - 2
src/main/java/com/template/services/impl/HousePriceServiceImpl.java

@@ -2,11 +2,10 @@ package com.template.services.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.template.model.pojo.HousePrice;
 import com.template.mapper.HousePriceMapper;
+import com.template.model.pojo.HousePrice;
 import com.template.model.result.PageUtils;
 import com.template.model.vo.AlterPriceRecordVo;
-import com.template.model.vo.HouseVo;
 import com.template.services.HousePriceService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;

+ 2 - 3
src/main/resources/mapper/template/HouseMapper.xml

@@ -34,9 +34,8 @@
         h.id as id
         FROM
         house h
-        WHERE
-         h.deleted=0
         <where>
+            h.deleted=0
             <if test="keyWord != null and keyWord != ''">
                 AND  h.room_type = #{type}
             </if>
@@ -44,7 +43,7 @@
         ) h1
         <where>
             <if test="keyWord != null and keyWord != ''">
-                and h1.roomId LIKE '%' #{keyWord} '%'
+                and h1.roomId LIKE concat('%',#{keyWord},'%')
             </if>
         </where>
 

+ 3 - 11
src/main/resources/mapper/template/HousePriceMapper.xml

@@ -15,28 +15,21 @@
         and t2.deleted = 0
         LEFT JOIN admin a on a.id = t1.create_user
         and a.deleted = 0
-        WHERE
-        t1.deleted = 0
         <where>
+            t1.deleted = 0
             <if test="type != null and type != ''">
                 AND t2.room_type = #{type}
             </if>
-        </where>
 
-        <where>
             <if test="houseName != null and houseName != ''">
                 AND t2.room_name = #{houseName}
             </if>
-        </where>
 
-        <where>
             <if test="operatingTime != null and operatingTime != ''">
                 AND t1.create_time BETWEEN SUBSTRING_INDEX(#{operatingTime}, ',', 1) and
                 SUBSTRING_INDEX(#{operatingTime}, ',', -1)
             </if>
-        </where>
 
-        <where>
             <if test="priceTime != null and priceTime != ''">
                 AND (substring_index(t1.set_date, ',', 1) BETWEEN SUBSTRING_INDEX(#{priceTime}, ',', 1) and
                 SUBSTRING_INDEX(#{priceTime}, ',', -1)
@@ -45,12 +38,11 @@
                 SUBSTRING_INDEX(#{priceTime}, ',', -1)
                 )
             </if>
-        </where>
 
-        <where>
             <if test="operatingName != null and operatingName != ''">
-                AND a.`name` LIKE '%' #{operatingName} '%'
+                AND a.`name` LIKE  '%' #{operatingName} '%'
             </if>
+
         </where>
 
         GROUP BY t1.id

BIN
target/classes/com/template/controller/HouseController.class


BIN
target/classes/com/template/controller/HousePriceController.class


BIN
target/classes/com/template/model/pojo/House.class


BIN
target/classes/com/template/model/pojo/HouseNumber.class


BIN
target/classes/com/template/model/pojo/HousePrice.class


BIN
target/classes/com/template/model/vo/HousedetailsVo.class


BIN
target/classes/com/template/services/impl/HousePriceServiceImpl.class


+ 2 - 3
target/classes/mapper/template/HouseMapper.xml

@@ -34,9 +34,8 @@
         h.id as id
         FROM
         house h
-        WHERE
-         h.deleted=0
         <where>
+            h.deleted=0
             <if test="keyWord != null and keyWord != ''">
                 AND  h.room_type = #{type}
             </if>
@@ -44,7 +43,7 @@
         ) h1
         <where>
             <if test="keyWord != null and keyWord != ''">
-                and h1.roomId LIKE '%' #{keyWord} '%'
+                and h1.roomId LIKE concat('%',#{keyWord},'%')
             </if>
         </where>
 

+ 3 - 11
target/classes/mapper/template/HousePriceMapper.xml

@@ -15,28 +15,21 @@
         and t2.deleted = 0
         LEFT JOIN admin a on a.id = t1.create_user
         and a.deleted = 0
-        WHERE
-        t1.deleted = 0
         <where>
+            t1.deleted = 0
             <if test="type != null and type != ''">
                 AND t2.room_type = #{type}
             </if>
-        </where>
 
-        <where>
             <if test="houseName != null and houseName != ''">
                 AND t2.room_name = #{houseName}
             </if>
-        </where>
 
-        <where>
             <if test="operatingTime != null and operatingTime != ''">
                 AND t1.create_time BETWEEN SUBSTRING_INDEX(#{operatingTime}, ',', 1) and
                 SUBSTRING_INDEX(#{operatingTime}, ',', -1)
             </if>
-        </where>
 
-        <where>
             <if test="priceTime != null and priceTime != ''">
                 AND (substring_index(t1.set_date, ',', 1) BETWEEN SUBSTRING_INDEX(#{priceTime}, ',', 1) and
                 SUBSTRING_INDEX(#{priceTime}, ',', -1)
@@ -45,12 +38,11 @@
                 SUBSTRING_INDEX(#{priceTime}, ',', -1)
                 )
             </if>
-        </where>
 
-        <where>
             <if test="operatingName != null and operatingName != ''">
-                AND a.`name` LIKE '%' #{operatingName} '%'
+                AND a.`name` LIKE  '%' #{operatingName} '%'
             </if>
+
         </where>
 
         GROUP BY t1.id