Forráskód Böngészése

土地出让关键字查询

zhao 6 hónapja
szülő
commit
8994d01d34

+ 1 - 0
nngkxxdp/pom.xml

@@ -237,6 +237,7 @@
             <artifactId>javase</artifactId>
             <version>3.3.0</version>
         </dependency>
+
     </dependencies>
     <profiles>
         <profile>

+ 1 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/controller/sellLandController.java

@@ -21,6 +21,7 @@ public class sellLandController {
         return sellLandService.findAll();
     }
 
+
     //根据id查询
     @GetMapping("/{id}")
     public BaseResult findById(@PathVariable("id")Long id) {

+ 1 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/dao/SellLandDao.java

@@ -30,6 +30,7 @@ public interface SellLandDao {
     Integer queryCount(SellLandQuery query);
 
     List<SellLand> queryData(SellLandQuery query);
+
 }
 
 

+ 2 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/entity/SellLand.java

@@ -14,6 +14,8 @@ public class SellLand implements Serializable {
     private String ownerUnit;   //业主单位
     private Integer landState;  //可用地状态
     private String businessIndustry;   //可招商产业
+
+    private Integer belongPark;
     /**
      * 土地出让表Id
      */

+ 1 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/query/SellLandQuery.java

@@ -6,4 +6,5 @@ import lombok.Data;
 @Data
 public class SellLandQuery extends BaseQuery {
     private Long parkId;
+    private String keyword;
 }

+ 2 - 1
nngkxxdp/src/main/java/com/example/nngkxxdp/service/impl/SellLandServiceImpl.java

@@ -1,6 +1,5 @@
 package com.example.nngkxxdp.service.impl;
 
-import cn.hutool.db.PageResult;
 import com.example.nngkxxdp.base.BusinessException;
 import com.example.nngkxxdp.dao.SellLandDao;
 import com.example.nngkxxdp.entity.SellLand;
@@ -62,6 +61,8 @@ public class SellLandServiceImpl implements SellLandService{
         return new pageResult<>(totals,list);
     }
 
+
+
 }
 
 

+ 12 - 8
nngkxxdp/src/main/resources/mapper/SellLandDao.xml

@@ -22,6 +22,7 @@
          <result property="businessIndustry" column="business_industry" jdbcType="VARCHAR"/>
          <result property="landState" column="land_state" jdbcType="INTEGER"/>
            <result property="point" column="point" jdbcType="VARCHAR"/>
+           <result property="belongPark" column="belong_park" jdbcType="INTEGER"/>
             <result property="createTime" column="create_time" jdbcType="VARCHAR"/>
            <association property="parkData" javaType="com.example.nngkxxdp.entity.ParkData">
             <result column="title" property="title"/>
@@ -79,17 +80,20 @@
     <select id="queryCount" resultType="java.lang.Integer">
         select count(*) from t_sell_land
         <if test="parkId != null">
-            where belong_park = #{parkId}
+            where belong_park = #{parkId} and land_name like concat('%', #{keyword}, '%')
         </if>
     </select>
-    <select id="queryData" resultType="com.example.nngkxxdp.entity.SellLand" resultMap="BaseResultMap">
-        select ts.*, ts.addr as landAddr,pd.title,pd.id,pd.addr as parkAddr
-        from t_sell_land ts
-        left join t_park_data pd on pd.id=ts.belong_park
-        <if test="parkId != null">
-            where belong_park = #{parkId}
-        </if>
+    <select id="queryData" resultType="com.example.nngkxxdp.entity.SellLand" >
+        select * from t_sell_land
+        <where>
+            belong_park = #{parkId}
+            <if test="keyword != null and keyword != ''">
+                and land_name like CONCAT('%', #{keyword}, '%')
+            </if>
+        </where>
         limit #{begin},#{pageSize}
     </select>
 
+
+
 </mapper>