123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- <?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.EntMapLayerMapper">
- <resultMap id="MapLayerDtoMap" type="com.zhyc.xps.sys.dto.EntMapLayerDto" >
- <result column="oc_id" property="ocId" jdbcType="BIGINT" />
- <result column="map_id" property="mapId" jdbcType="BIGINT" />
- <result column="map_raster_layer" property="mapRasterLayer" jdbcType="BIGINT" />
- <result column="layer_id" property="layerId" jdbcType="BIGINT" />
- <result column="layer_cat_id" property="layerCatId" jdbcType="BIGINT" />
- <result column="layer_title" property="layerTitle" jdbcType="VARCHAR"/>
- <result column="layer_marker" property="layerMarker" jdbcType="VARCHAR"/>
- <result column="layer_vector" property="layerVector" jdbcType="VARCHAR"/>
- <result column="layer_vector_type" property="layerVectorType" jdbcType="BIGINT" />
- </resultMap>
- <sql id="MapLayerDto_Cols">
- A.oc_id,
- A.map_id,
- B.map_raster_layer,
- A.layer_id,
- A.layer_cat_id,
- A.layer_title,
- A.layer_marker,
- A.layer_vector,
- A.layer_vector_type
- </sql>
- <!--根据ID获取信息-->
- <select id="getById" resultMap="MapLayerDtoMap">
- SELECT
- <include refid="MapLayerDto_Cols"/>
- FROM ent_map_layer AS A
- LEFT JOIN ent_map AS B ON (A.oc_id = B.oc_id AND A.map_id = B.map_id)
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="mapId != null">
- AND A.map_id = #{mapId ,jdbcType=BIGINT}
- </if>
- <if test="layerId != null">
- AND A.layer_id = #{layerId ,jdbcType=BIGINT}
- </if>
- LIMIT 0, 1
- </select>
- <!--分页查询信息-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="MapLayerDtoMap">
- SELECT
- <include refid="MapLayerDto_Cols"/>
- FROM ent_map_layer AS A
- LEFT JOIN ent_map AS B ON (A.oc_id = B.oc_id AND A.map_id = B.map_id)
- WHERE 1 = 1 AND A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="mapId != null">
- AND A.map_id = #{mapId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.layer_title like "%"#{keywords}"%"
- </if>
- ORDER BY A.layer_id ASC
- </select>
- <select id="getByList" parameterType="java.util.Map" resultMap="MapLayerDtoMap">
- SELECT
- <include refid="MapLayerDto_Cols"/>
- FROM ent_map_layer AS A
- LEFT JOIN ent_map AS B ON (A.oc_id = B.oc_id AND A.map_id = B.map_id)
- WHERE 1 = 1 AND A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="mapId != null">
- AND A.map_id = #{mapId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.layer_title like "%"#{keywords}"%"
- </if>
- ORDER BY A.layer_id ASC
- </select>
- <insert id="create" parameterType="com.zhyc.xps.sys.entity.EntMapLayer">
- INSERT INTO ent_map_layer
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="mapId != null">
- map_id,
- </if>
- <if test="layerId != null">
- layer_id,
- </if>
- <if test="layerCatId != null">
- layer_cat_id,
- </if>
- <if test="layerTitle != null and layerTitle != ''">
- layer_title,
- </if>
- <if test="layerMarker != null and layerMarker != ''">
- layer_marker,
- </if>
- <if test="layerVector != null and layerVector != ''">
- layer_vector,
- </if>
- <if test="layerVectorType != null">
- layerVectorType,
- </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="layerId != null">
- #{layerId ,jdbcType=BIGINT},
- </if>
- <if test="layerCatId != null">
- #{layerCatId ,jdbcType=BIGINT},
- </if>
- <if test="layerTitle != null and layerTitle != ''">
- #{layerTitle ,jdbcType=VARCHAR},
- </if>
- <if test="layerMarker != null and layerMarker != ''">
- #{layerMarker ,jdbcType=VARCHAR},
- </if>
- <if test="layerVector != null and layerVector != ''">
- #{layerVector ,jdbcType=VARCHAR},
- </if>
- <if test="layerVectorType != null">
- #{layerVectorType ,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.EntMapLayer">
- UPDATE ent_map_layer
- <trim suffixOverrides=",">
- <set>
- <if test="mapId != null">
- map_id = #{mapId ,jdbcType=BIGINT},
- </if>
- <if test="layerTitle != null and layerTitle != ''">
- layer_title = #{layerTitle ,jdbcType=VARCHAR},
- </if>
- <if test="layerMarker != null and layerMarker != ''">
- layer_marker = #{layerMarker ,jdbcType=VARCHAR},
- </if>
- <if test="layerVector != null and layerVector != ''">
- layer_vector = #{layerVector ,jdbcType=VARCHAR},
- </if>
- <if test="layerVectorType != null">
- layer_vector_type = #{layerVectorType ,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 oc_id = #{ocId ,jdbcType=BIGINT}
- AND layer_id = #{layerId ,jdbcType=BIGINT}
- </update>
- <!--删除-->
- <delete id="delete" parameterType="java.util.Map">
- DELETE FROM ent_map_layer
- 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>
- <if test="layerId != null">
- AND layer_id = #{layerId ,jdbcType=BIGINT}
- </if>
- </delete>
- </mapper>
|