123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <?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.aqpt.mapper.EntRiskPointMapLayerMapper">
- <resultMap id="RiskPointMapLayerDtoMap" type="com.zhyc.xps.aqpt.dto.EntRiskPointMapLayerDto">
- <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
- <result column="risk_point_id" property="riskPointId" jdbcType="BIGINT"/>
- <result column="map_id" property="mapId" jdbcType="BIGINT"/>
- <result column="layer_id" property="layerId" jdbcType="BIGINT"/>
- <result column="risk_point_title" property="riskPointTitle" jdbcType="VARCHAR"/>
- <result column="map_raster_layer" property="mapRasterLayer" jdbcType="VARCHAR"/>
- <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="VARCHAR"/>
- </resultMap>
- <sql id="Ext_Column_List">
- A.oc_id,
- A.map_id,
- C.map_raster_layer,
- A.risk_point_id,
- B.risk_point_title,
- A.layer_id,
- D.layer_title,
- D.layer_marker,
- D.layer_vector,
- D.layer_vector_type
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="RiskPointMapLayerDtoMap">
- SELECT
- <include refid="Ext_Column_List"/>
- FROM ent_risk_point_map_layer AS A
- LEFT JOIN ent_risk_point AS B ON (A.oc_id = B.oc_id AND A.risk_point_id = B.risk_point_id)
- LEFT JOIN ent_map AS C ON (A.oc_id = C.oc_id AND A.map_id = C.map_id )
- LEFT JOIN ent_map_layer AS D ON (A.oc_id = D.oc_id AND A.map_id = D.map_id AND A.layer_id = D.layer_id)
- WHERE 1 = 1 AND A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="riskPointId != null">
- AND A.risk_point_id = #{riskPointId ,jdbcType=BIGINT}
- </if>
- LIMIT 0, 1
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="RiskPointMapLayerDtoMap">
- SELECT
- <include refid="Ext_Column_List"/>
- FROM ent_risk_point_map_layer AS A
- LEFT JOIN ent_risk_point AS B ON (A.oc_id = B.oc_id AND A.risk_point_id = B.risk_point_id)
- LEFT JOIN ent_map AS C ON (A.oc_id = C.oc_id AND A.map_id = C.map_id )
- LEFT JOIN ent_map_layer AS D ON (A.oc_id = D.oc_id AND A.map_id = D.map_id AND A.layer_id = D.layer_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 D.layer_title like "%"#{keywords}"%"
- </if>
- ORDER BY A.risk_point_id ASC
- </select>
- <!--列表查询-->
- <select id="getByList" parameterType="java.util.Map" resultMap="RiskPointMapLayerDtoMap">
- SELECT
- <include refid="Ext_Column_List"/>
- FROM ent_risk_point_map_layer AS A
- LEFT JOIN ent_risk_point AS B ON (A.oc_id = B.oc_id AND A.risk_point_id = B.risk_point_id)
- LEFT JOIN ent_map AS C ON (A.oc_id = C.oc_id AND A.map_id = C.map_id )
- LEFT JOIN ent_map_layer AS D ON (A.oc_id = D.oc_id AND A.map_id = D.map_id AND A.layer_id = D.layer_id)
- WHERE A.deleted_flag = 0 and B.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 D.layer_title like "%"#{keywords}"%"
- </if>
- ORDER BY A.risk_point_id ASC
- </select>
- <insert id="create" parameterType="com.zhyc.xps.aqpt.entity.EntRiskPointMapLayer">
- INSERT INTO ent_risk_point_map_layer
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="riskPointId != null">
- risk_point_id,
- </if>
- <if test="mapId != null">
- map_id,
- </if>
- <if test="layerId != null">
- layer_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="riskPointId != null">
- #{riskPointId ,jdbcType=BIGINT},
- </if>
- <if test="mapId != null">
- #{mapId ,jdbcType=BIGINT},
- </if>
- <if test="layerId != null">
- #{layerId ,jdbcType=BIGINT},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--删除-->
- <delete id="delete" parameterType="java.util.Map">
- DELETE FROM ent_risk_point_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>
- <if test="riskPointId != null">
- AND risk_point_id = #{riskPointId ,jdbcType=BIGINT}
- </if>
- </delete>
- </mapper>
|