Newer
Older
huludao / src / main / resources / mapper / pipenetwork / PipelineInfoMapper.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.pipenetwork.dao.JbPipelineInfoDao">

    <!-- 通用映射列 -->
    <resultMap id="BaseResultMap" type="com.xf.huludao.pipenetwork.entity.PipelineInfo">
        <result column="id" property="id"/>
        <result column="pipeline_code" property="pipelineCode"/>
        <result column="start_well_number" property="startWellNumber"/>
        <result column="end_well_number" property="endWellNumber"/>
        <result column="start_point" property="startPoint"/>
        <result column="end_point" property="endPoint"/>
        <result column="pipeline_material" property="pipelineMaterial"/>
        <result column="pipeline_diameter" property="pipelineDiameter"/>
        <result column="burying_way" property="buryingWay"/>
        <result column="pipe_bottom_depth" property="pipeBottomDepth"/>
        <result column="pipe_tail_depth" property="pipeTailDepth"/>
        <result column="pipe_bottom_elevation" property="pipeBottomElevation"/>
        <result column="pipe_tail_elevation" property="pipeTailElevation"/>
        <result column="pipeline_type" property="pipelineType"/>
        <result column="pipeline_length" property="pipelineLength"/>
        <result column="slope" property="slope"/>
        <result column="pipeline_trend" property="pipelineTrend"/>
        <result column="rainwater_system" property="rainwaterSystem"/>
        <result column="sewage_system" property="sewageSystem"/>
        <result column="administration_region" property="administrationRegion"/>
        <result column="level" property="level"/>
        <result column="flow" property="flow"/>
        <result column="water_level" property="waterLevel"/>
        <result column="road_name" property="roadName"/>
        <result column="census_time" property="censusTime"/>
        <result column="survey_area" property="surveyArea"/>
        <result column="owner_unit" property="ownerUnit"/>
        <result column="shape_leng" property="shapeLeng"/>
        <result column="gjtype" property="gjtype"/>
        <result column="access_unit" property="accessUnit"/>
        <result column="run_water" property="runWater"/>
        <result column="remark" property="remark"/>
        <result column="width_height_1" property="widthHeight1"/>
        <result column="width_height_2" property="widthHeight2"/>
        <result column="length_calc" property="lengthCalc"/>
        <result column="geometrys" property="geometry"/>
        <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="is_deleted" property="isDeleted"/>
        <result column="region_code" property="regionCode"/>
    </resultMap>

    <!-- 通用数据库列 -->
    <sql id="Base_Column_List">
              id,
              pipeline_code,
              start_well_number,
              end_well_number,
              start_point,
              end_point,
              pipeline_material,
              pipeline_diameter,
              burying_way,
              pipe_bottom_depth,
              pipe_tail_depth,
              pipe_bottom_elevation,
              pipe_tail_elevation,
              pipeline_type,
              pipeline_length,
              slope,
              pipeline_trend,
              rainwater_system,
              sewage_system,
              administration_region,
              level,
              flow,
              water_level,
              road_name,
              census_time,
              survey_area,
              owner_unit,
              shape_leng,
              gjtype,
              access_unit,
              run_water,
              remark,
              width_height_1,
              width_height_2,
              length_calc,
              ST_AsText(geometrys) as geometrys,
              create_user,
              create_dept,
              create_time,
              update_user,
              update_time,
              is_deleted,
              region_code
          </sql>

    <sql id="Where_Condition">
        <if test="request.id != null and request.id != ''">
            and id = #{request.id}
        </if>
        <if test="request.pipelineCode != null and request.pipelineCode != ''">
            and pipeline_code = #{request.pipelineCode}
        </if>
        <if test="request.startWellNumber != null and request.startWellNumber != ''">
            and start_well_number = #{request.startWellNumber}
        </if>
        <if test="request.endWellNumber != null and request.endWellNumber != ''">
            and end_well_number = #{request.endWellNumber}
        </if>
        <if test="request.startPoint != null and request.startPoint != ''">
            and start_point = #{request.startPoint}
        </if>
        <if test="request.endPoint != null and request.endPoint != ''">
            and end_point = #{request.endPoint}
        </if>
        <if test="request.pipelineMaterial != null and request.pipelineMaterial != ''">
            and pipeline_material = #{request.pipelineMaterial}
        </if>
        <if test="request.pipelineDiameter != null and request.pipelineDiameter != ''">
            and pipeline_diameter = #{request.pipelineDiameter}
        </if>
        <if test="request.buryingWay != null and request.buryingWay != ''">
            and burying_way = #{request.buryingWay}
        </if>
        <if test="request.pipeBottomDepth != null and request.pipeBottomDepth != ''">
            and pipe_bottom_depth = #{request.pipeBottomDepth}
        </if>
        <if test="request.pipeTailDepth != null and request.pipeTailDepth != ''">
            and pipe_tail_depth = #{request.pipeTailDepth}
        </if>
        <if test="request.pipeBottomElevation != null and request.pipeBottomElevation != ''">
            and pipe_bottom_elevation = #{request.pipeBottomElevation}
        </if>
        <if test="request.pipeTailElevation != null and request.pipeTailElevation != ''">
            and pipe_tail_elevation = #{request.pipeTailElevation}
        </if>
        <if test="request.pipelineType != null and request.pipelineType != ''">
            and pipeline_type = #{request.pipelineType}
        </if>
        <if test="request.pipelineLength != null and request.pipelineLength != ''">
            and pipeline_length = #{request.pipelineLength}
        </if>
        <if test="request.slope != null and request.slope != ''">
            and slope = #{request.slope}
        </if>
        <if test="request.pipelineTrend != null and request.pipelineTrend != ''">
            and pipeline_trend = #{request.pipelineTrend}
        </if>
        <if test="request.rainwaterSystem != null and request.rainwaterSystem != ''">
            and rainwater_system = #{request.rainwaterSystem}
        </if>
        <if test="request.sewageSystem != null and request.sewageSystem != ''">
            and sewage_system = #{request.sewageSystem}
        </if>
        <if test="request.administrationRegion != null and request.administrationRegion != ''">
            and administration_region = #{request.administrationRegion}
        </if>
        <if test="request.level != null and request.level != ''">
            and level = #{request.level}
        </if>
        <if test="request.flow != null and request.flow != ''">
            and flow = #{request.flow}
        </if>
        <if test="request.waterLevel != null and request.waterLevel != ''">
            and water_level = #{request.waterLevel}
        </if>
        <if test="request.roadName != null and request.roadName != ''">
            and road_name = #{request.roadName}
        </if>
        <if test="request.censusTime != null and request.censusTime != ''">
            and census_time = #{request.censusTime}
        </if>
        <if test="request.surveyArea != null and request.surveyArea != ''">
            and survey_area = #{request.surveyArea}
        </if>
        <if test="request.ownerUnit != null and request.ownerUnit != ''">
            and owner_unit = #{request.ownerUnit}
        </if>
        <if test="request.shapeLeng != null and request.shapeLeng != ''">
            and shape_leng = #{request.shapeLeng}
        </if>
        <if test="request.gjtype != null and request.gjtype != ''">
            and gjtype = #{request.gjtype}
        </if>
        <if test="request.accessUnit != null and request.accessUnit != ''">
            and access_unit = #{request.accessUnit}
        </if>
        <if test="request.runWater != null and request.runWater != ''">
            and run_water = #{request.runWater}
        </if>
        <if test="request.remark != null and request.remark != ''">
            and remark = #{request.remark}
        </if>
        <if test="request.widthHeight1 != null and request.widthHeight1 != ''">
            and width_height_1 = #{request.widthHeight1}
        </if>
        <if test="request.widthHeight2 != null and request.widthHeight2 != ''">
            and width_height_2 = #{request.widthHeight2}
        </if>
        <if test="request.lengthCalc != null and request.lengthCalc != ''">
            and length_calc = #{request.lengthCalc}
        </if>
        <if test="request.geometry != null and request.geometry != ''">
            and geometry = #{request.geometry}
        </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.isDeleted != null and request.isDeleted != ''">
            and is_deleted = #{request.isDeleted}
        </if>
        <if test="request.regionCode != null and request.regionCode != ''">
            and region_code = #{request.regionCode}
        </if>
    </sql>

    <select id="selectByCondition" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from pipeline_info
        where is_deleted = 0
    </select>
    <select id="queryAllnodes" resultType="com.xf.huludao.pipenetwork.entity.PipelinePointNumber">
        select * from pipeline_point_number
    </select>


</mapper>