| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?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.ufo.project.config.mapper.ConfigAreaMapper">
-
- <resultMap type="ConfigArea" id="ConfigAreaResult">
- <result property="id" column="id" />
- <result property="areaCode" column="area_code" />
- <result property="areaName" column="area_name" />
- <result property="superiorAreaId" column="superior_area_id" />
- <result property="isDel" column="is_del" />
- <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="selectConfigAreaVo">
- select id, area_code, area_name, superior_area_id, is_del, create_by, create_time, update_by, update_time from config_area
- </sql>
- <select id="selectConfigAreaList" parameterType="ConfigArea" resultMap="ConfigAreaResult">
- <include refid="selectConfigAreaVo"/>
- <where>
- <if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
- <if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
- <if test="superiorAreaId != null and superiorAreaId != ''"> and superior_area_id = #{superiorAreaId}</if>
- <if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
- </where>
- </select>
-
- <select id="selectConfigAreaById" parameterType="String" resultMap="ConfigAreaResult">
- <include refid="selectConfigAreaVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertConfigArea" parameterType="ConfigArea">
- insert into config_area
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null and id != ''">id,</if>
- <if test="areaCode != null and areaCode != ''">area_code,</if>
- <if test="areaName != null and areaName != ''">area_name,</if>
- <if test="superiorAreaId != null">superior_area_id,</if>
- <if test="isDel != null and isDel != ''">is_del,</if>
- <if test="createBy != null and createBy != ''">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null and updateBy != ''">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null and id != ''">#{id},</if>
- <if test="areaCode != null and areaCode != ''">#{areaCode},</if>
- <if test="areaName != null and areaName != ''">#{areaName},</if>
- <if test="superiorAreaId != null">#{superiorAreaId},</if>
- <if test="isDel != null and isDel != ''">#{isDel},</if>
- <if test="createBy != null and createBy != ''">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- </trim>
- </insert>
- <update id="updateConfigArea" parameterType="ConfigArea">
- update config_area
- <trim prefix="SET" suffixOverrides=",">
- <if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
- <if test="areaName != null and areaName != ''">area_name = #{areaName},</if>
- <if test="superiorAreaId != null">superior_area_id = #{superiorAreaId},</if>
- <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
- <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteConfigAreaById" parameterType="String">
- delete from config_area where id = #{id}
- </delete>
- <delete id="deleteConfigAreaByIds" parameterType="String">
- delete from config_area where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|