|
@@ -0,0 +1,115 @@
|
|
|
+<?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.ruoyi.qdtl.mapper.TlAreaMapper">
|
|
|
+
|
|
|
+ <resultMap type="TlArea" id="TlAreaResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="parentId" column="parent_id" />
|
|
|
+ <result property="areaCode" column="area_code" />
|
|
|
+ <result property="areaName" column="area_name" />
|
|
|
+ <result property="areaType" column="area_type" />
|
|
|
+ <result property="detail" column="detail" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="fence" column="fence" />
|
|
|
+ <result property="lnglat" column="lnglat" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectTlAreaVo">
|
|
|
+ select id, parent_id, area_code, area_name, area_type, detail, remark, fence, lnglat, del_flag, create_by, create_time, update_by, update_time from tl_area
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectTlAreaList" parameterType="TlArea" resultMap="TlAreaResult">
|
|
|
+ <include refid="selectTlAreaVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="areaCode != null and areaCode != ''"> and area_code like concat('%', #{areaCode}, '%')</if>
|
|
|
+ <if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
|
|
|
+ <if test="areaType != null and areaType != ''"> and area_type = #{areaType}</if>
|
|
|
+ and del_flag = '0'
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTlAreaById" parameterType="Long" resultMap="TlAreaResult">
|
|
|
+ <include refid="selectTlAreaVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ and del_flag = '0'
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectExist" resultType="java.lang.Integer">
|
|
|
+ select count(1) from tl_area
|
|
|
+ where (area_code = #{areaCode}
|
|
|
+ or area_name = #{areaName})
|
|
|
+ and del_flag = '0'
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTlArea" parameterType="TlArea" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into tl_area
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="parentId != null">parent_id,</if>
|
|
|
+ <if test="areaCode != null and areaCode != ''">area_code,</if>
|
|
|
+ <if test="areaName != null and areaName != ''">area_name,</if>
|
|
|
+ <if test="areaType != null and areaType != ''">area_type,</if>
|
|
|
+ <if test="detail != null">detail,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="fence != null">fence,</if>
|
|
|
+ <if test="lnglat != null">lnglat,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="parentId != null">#{parentId},</if>
|
|
|
+ <if test="areaCode != null and areaCode != ''">#{areaCode},</if>
|
|
|
+ <if test="areaName != null and areaName != ''">#{areaName},</if>
|
|
|
+ <if test="areaType != null and areaType != ''">#{areaType},</if>
|
|
|
+ <if test="detail != null">#{detail},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="fence != null">#{fence},</if>
|
|
|
+ <if test="lnglat != null">#{lnglat},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTlArea" parameterType="TlArea">
|
|
|
+ update tl_area
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
+ <if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
|
|
|
+ <if test="areaName != null and areaName != ''">area_name = #{areaName},</if>
|
|
|
+ <if test="areaType != null and areaType != ''">area_type = #{areaType},</if>
|
|
|
+ <if test="detail != null">detail = #{detail},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="fence != null">fence = #{fence},</if>
|
|
|
+ <if test="lnglat != null">lnglat = #{lnglat},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteTlAreaById" parameterType="Long">
|
|
|
+ delete from tl_area where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteTlAreaByIds" parameterType="String">
|
|
|
+ delete from tl_area where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|