Newer
Older
huludao / src / main / resources / mapper / project / GisLayerZqdlyxhmcsjssfgcMapper.xml
<?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.xf.huludao.project.dao.GisLayerZqdlyxhmcsjssfgcMapper">

    <!-- 通用映射列 -->
    <resultMap id="BaseResultMap" type="com.xf.huludao.project.entity.GisLayerZqdlyxhmcsjssfgc">
        <result column="UserID" property="UserID"/>
        <result column="地块名" property="地块名"/>
        <result column="FIRST_分" property="first分"/>
        <result column="SUM_Shape_" property="sumShape"/>
        <result column="FIRST_类" property="first类"/>
        <result column="分区" property="分区"/>
        <result column="备注" property="备注"/>
        <result column="geometrys" property="geometrys"/>
        <result column="project_no" property="projectNo"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>

    <!-- 通用数据库列 -->
    <sql id="Base_Column_List">
              UserID,
              地块名,
              FIRST_分,
              SUM_Shape_,
              FIRST_类,
              分区,
              备注,
              ST_AsText(geometrys) as geometrys,
              project_no,
              create_user,
              create_dept,
              create_time,
              update_user,
              update_time,
              status,
              is_deleted
          </sql>

    <sql id="Where_Condition">
        <if test="request.UserID != null and request.UserID != ''">
            and UserID = #{request.UserID}
        </if>
        <if test="request.地块名 != null and request.地块名 != ''">
            and 地块名 = #{request.地块名}
        </if>
        <if test="request.first分 != null and request.first分 != ''">
            and FIRST_分 = #{request.first分}
        </if>
        <if test="request.sumShape != null and request.sumShape != ''">
            and SUM_Shape_ = #{request.sumShape}
        </if>
        <if test="request.first类 != null and request.first类 != ''">
            and FIRST_类 = #{request.first类}
        </if>
        <if test="request.分区 != null and request.分区 != ''">
            and 分区 = #{request.分区}
        </if>
        <if test="request.备注 != null and request.备注 != ''">
            and 备注 = #{request.备注}
        </if>
        <if test="request.geometrys != null and request.geometrys != ''">
            and geometrys = #{request.geometrys}
        </if>
        <if test="request.projectNo != null and request.projectNo != ''">
            and project_no = #{request.projectNo}
        </if>
        <if test="request.createUser != null and request.createUser != ''">
            and create_user = #{request.createUser}
        </if>
        <if test="request.createDept != null and request.createDept != ''">
            and create_dept = #{request.createDept}
        </if>
        <if test="request.createTime != null and request.createTime != ''">
            and create_time = #{request.createTime}
        </if>
        <if test="request.updateUser != null and request.updateUser != ''">
            and update_user = #{request.updateUser}
        </if>
        <if test="request.updateTime != null and request.updateTime != ''">
            and update_time = #{request.updateTime}
        </if>
        <if test="request.status != null and request.status != ''">
            and status = #{request.status}
        </if>
        <if test="request.isDeleted != null and request.isDeleted != ''">
            and is_deleted = #{request.isDeleted}
        </if>
    </sql>

    <select id="selectByCondition" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from gis_layer_zqdlyxhmcsjssfgc
        where is_deleted = 0
        <include refid="Where_Condition"/>
    </select>

    <select id="exportGisLayerZqdlyxhmcsjssfgc" resultType="com.xf.huludao.project.entity.GisLayerZqdlyxhmcsjssfgc">
        SELECT * FROM gis_layer_zqdlyxhmcsjssfgc ${ew.customSqlSegment}
    </select>
</mapper>