|
@@ -0,0 +1,96 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!DOCTYPE mapper
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.example.nngkxxdp.dao.SellLandDao">
|
|
|
+
|
|
|
+ <resultMap id="BaseResultMap" type="com.example.nngkxxdp.entity.SellLand">
|
|
|
+ <id property="id" column="id" jdbcType="INTEGER"/>
|
|
|
+ <result property="landName" column="land_name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="landArea" column="land_area" jdbcType="VARCHAR"/>
|
|
|
+ <result property="landFunction" column="land_function" jdbcType="VARCHAR"/>
|
|
|
+ <result property="basicConfiguration" column="basic_configuration" jdbcType="VARCHAR"/>
|
|
|
+ <result property="usableArea" column="usable_area" jdbcType="VARCHAR"/>
|
|
|
+ <result property="addr" column="addr" jdbcType="VARCHAR"/>
|
|
|
+ <result property="contactName" column="contact_name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="contactPhone" column="contact_phone" jdbcType="VARCHAR"/>
|
|
|
+ <result property="introduce" column="introduce" jdbcType="VARCHAR"/>
|
|
|
+ <result property="cost" column="cost" jdbcType="VARCHAR"/>
|
|
|
+ <result property="imgUrl" column="img_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="point" column="point" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="VARCHAR"/>
|
|
|
+ <association property="parkData" javaType="com.example.nngkxxdp.entity.ParkData">
|
|
|
+ <result column="title" property="title"/>
|
|
|
+ <result column="id" property="id"/>
|
|
|
+ <result column="parkAddr" property="addr"/>
|
|
|
+ </association>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id,land_name,land_area,
|
|
|
+ land_function,basic_configuration,usable_area,
|
|
|
+ addr,contact_name,contact_phone,
|
|
|
+ introduce,water,electricity,
|
|
|
+ natural_gas,cost,labour,
|
|
|
+ img_url,create_time
|
|
|
+ </sql>
|
|
|
+ <insert id="insert" parameterType="com.example.nngkxxdp.entity.SellLand" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
|
|
+ insert into t_sell_land(land_name,land_area,land_function,basic_configuration,usable_area,addr,contact_name,contact_phone,introduce,water,electricity,natural_gas,cost,labour,img_url,remark,belong_park,point,create_time)
|
|
|
+ values(#{landName},#{landArea},#{landFunction},#{basicConfiguration},#{usableArea},#{addr},#{contactName},#{contactPhone},#{introduce},#{water},#{electricity},#{naturalGas},#{cost},#{labour},#{imgUrl},#{remark},#{belongPark},#{point},#{createTime})
|
|
|
+ </insert>
|
|
|
+ <insert id="countAll">
|
|
|
+ select count(*) from t_sell_land
|
|
|
+ </insert>
|
|
|
+ <update id="update">
|
|
|
+ update t_sell_land
|
|
|
+ set land_name = #{landName},
|
|
|
+ land_area = #{landArea},
|
|
|
+ land_function = #{landFunction},
|
|
|
+ basic_configuration = #{basicConfiguration},
|
|
|
+ usable_area = #{usableArea},
|
|
|
+ addr = #{addr},
|
|
|
+ contact_name = #{contactName},
|
|
|
+ contact_phone = #{contactPhone},
|
|
|
+ introduce = #{introduce},
|
|
|
+ water = #{water},
|
|
|
+ electricity = #{electricity},
|
|
|
+ natural_gas = #{naturalGas},
|
|
|
+ cost = #{cost},
|
|
|
+ labour = #{labour},
|
|
|
+ img_url = #{imgUrl},
|
|
|
+ remark = #{remark},
|
|
|
+ point = #{point},
|
|
|
+ belong_park=#{belongPark}
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete from t_sell_land where id = #{id}
|
|
|
+ </delete>
|
|
|
+ <select id="findAll" resultType="com.example.nngkxxdp.entity.SellLand">
|
|
|
+ select * from t_sell_land
|
|
|
+ </select>
|
|
|
+ <select id="findById" 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
|
|
|
+ where ts.id = #{id}
|
|
|
+ </select>
|
|
|
+ <select id="queryCount" resultType="java.lang.Integer">
|
|
|
+ select count(*) from t_sell_land
|
|
|
+ <if test="parkId != null">
|
|
|
+ where belong_park = #{parkId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="queryData" resultType="com.example.nngkxxdp.entity.SellLand">
|
|
|
+ select * from t_sell_land
|
|
|
+ <if test="parkId != null">
|
|
|
+ where belong_park = #{parkId}
|
|
|
+ </if>
|
|
|
+ limit #{begin},#{pageSize}
|
|
|
+ </select>
|
|
|
+ <select id="findPagedEntities" resultType="com.example.nngkxxdp.entity.SellLand">
|
|
|
+ SELECT *
|
|
|
+ FROM t_sell_land
|
|
|
+ LIMIT ${offset}, ${limit}
|
|
|
+ </select>
|
|
|
+</mapper>
|