123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <?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.zhyc.xps.sys.mapper.EntMapMapper">
- <resultMap id="MapDtoMap" type="com.zhyc.xps.sys.dto.EntMapDto">
- <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
- <result column="map_id" property="mapId" jdbcType="BIGINT"/>
- <result column="map_title" property="mapTitle" jdbcType="VARCHAR"/>
- <result column="map_desc" property="mapDesc" jdbcType="VARCHAR"/>
- <result column="map_cat_id" property="mapCatId" jdbcType="BIGINT"/>
- <result column="map_raster_layer" property="mapRasterLayer" jdbcType="VARCHAR"/>
- <result column="map_type_id" property="mapTypeId" jdbcType="BIGINT"/>
- </resultMap>
- <sql id="MapDto_Cols">
- oc_id,
- map_id,
- map_title,
- map_desc,
- map_cat_id,
- map_raster_layer,
- map_type_id
- </sql>
- <!--根据ID获取信息-->
- <select id="getById" resultMap="MapDtoMap">
- SELECT
- <include refid="MapDto_Cols"/>
- FROM ent_map
- WHERE 1 = 1
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="mapId != null">
- AND map_id = #{mapId ,jdbcType=BIGINT}
- </if>
- </select>
- <!--分页查询信息-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="MapDtoMap">
- SELECT
- <include refid="MapDto_Cols"/>
- FROM ent_map
- WHERE 1 = 1 AND deleted_flag = 0
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- and map_title like "%"#{keywords}"%"
- </if>
- ORDER BY map_id ASC
- </select>
- <select id="getByList" parameterType="java.util.Map" resultMap="MapDtoMap" >
- SELECT
- <include refid="MapDto_Cols"/>
- FROM ent_map
- WHERE 1 = 1 AND deleted_flag = 0
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND map_title like "%"#{keywords}"%"
- </if>
- </select>
- <insert id="create" parameterType="com.zhyc.xps.sys.entity.EntMap">
- INSERT INTO ent_map
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="mapId != null">
- map_id,
- </if>
- <if test="mapTitle != null">
- map_title,
- </if>
- <if test="mapDesc != null">
- map_desc,
- </if>
- <if test="mapRasterLayer != null">
- map_raster_layer,
- </if>
- <if test="mapCatId != null">
- map_cat_id,
- </if>
- <if test="mapTypeId != null">
- map_type_id,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- #{ocId ,jdbcType=BIGINT},
- </if>
- <if test="mapId != null">
- #{mapId ,jdbcType=BIGINT},
- </if>
- <if test="mapTitle != null">
- #{mapTitle ,jdbcType=VARCHAR},
- </if>
- <if test="mapDesc != null">
- #{mapDesc ,jdbcType=VARCHAR},
- </if>
- <if test="mapRasterLayer != null">
- #{mapRasterLayer ,jdbcType=BIGINT},
- </if>
- <if test="mapCatId != null">
- #{mapCatId ,jdbcType=BIGINT},
- </if>
- <if test="mapTypeId != null">
- #{mapTypeId ,jdbcType=BIGINT},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--更新-->
- <update id="update" parameterType="com.zhyc.xps.sys.entity.EntMap">
- UPDATE ent_map
- <trim suffixOverrides=",">
- <set>
- <if test="mapTitle != null and mapTitle != ''">
- map_title = #{mapTitle, jdbcType=VARCHAR},
- </if>
- <if test="mapDesc != null and mapDesc != ''">
- map_desc = #{mapDesc, jdbcType=VARCHAR},
- </if>
- <if test="mapRasterLayer != null and mapRasterLayer != ''">
- map_raster_layer = #{mapRasterLayer ,jdbcType=VARCHAR},
- </if>
- <if test="mapCatId != null">
- map_cat_id = #{mapCatId ,jdbcType=BIGINT},
- </if>
- <if test="mapTypeId != null">
- map_type_id = #{mapTypeId ,jdbcType=BIGINT},
- </if>
- <if test="updatedBy != null ">
- updated_by = #{updatedBy ,jdbcType=BIGINT},
- </if>
- <if test="updatedAt != null">
- updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="mapId != null">
- AND map_id = #{mapId ,jdbcType=BIGINT}
- </if>
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE ent_map
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag, jdbcType=BIGINT},
- </if>
- <if test="deletedAt != null">
- deleted_at = #{deletedAt, jdbcType=TIMESTAMP},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE 1 =1
- <if test="mapId != null">
- AND map_id = #{mapId ,jdbcType=BIGINT}
- </if>
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|