<?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.huashe.park.core.mapper.ProjectCoordinateInfoMapper">

    <resultMap type="ProjectCoordinateInfo" id="ProjectCoordinateInfoResult">
        <result property="id" column="id"/>
        <result property="projectId" column="project_id"/>
        <result property="strName" column="str_name"/>
        <result property="da" column="da"/>
        <result property="df" column="df"/>
        <result property="dreferenceLatitude" column="dreference_latitude"/>
        <result property="dcentralMeridian" column="dcentral_meridian"/>
        <result property="dreferenceLongitude" column="dreference_longitude"/>
        <result property="dprojectionHeight" column="dprojection_height"/>
        <result property="projectionName" column="projection_name"/>
        <result property="heightFittingParameter" column="height_fitting_parameter"/>
        <result property="constructionP4" column="construction_p4"/>
        <result property="createType" column="create_type"/>
        <result property="projectionId" column="projection_id"/>
        <result property="constructionP7" column="construction_p7"/>
        <result property="projectType" column="project_type"/>
        <result property="dtx" column="dtx"/>
        <result property="dty" column="dty"/>
        <result property="ntype" column="ntype"/>
        <result property="dtk" column="dtk"/>
        <result property="updateTime" column="update_time"/>
        <result property="createTime" column="create_time"/>
        <result property="createBy" column="create_by"/>
        <result property="updateBy" column="update_by"/>
        <result property="tenantId" column="tenant_id"/>
    </resultMap>

    <sql id="selectProjectCoordinateInfoVo">
        select id,
               project_id,
               str_name,
               da,
               df,
               dreference_latitude,
               dcentral_meridian,
               dreference_longitude,
               dprojection_height,
               projection_name,
               height_fitting_parameter,
               construction_p4,
               create_type,
               projection_id,
               construction_p7,
               project_type,
               dtx,
               dty,
               ntype,
               dtk,
               update_time,
               create_time,
               create_by,
               update_by,
               tenant_id
        from cons_project_coordinate_info
    </sql>

    <select id="selectProjectCoordinateInfoList" parameterType="ProjectCoordinateInfo"
            resultMap="ProjectCoordinateInfoResult">
        <include refid="selectProjectCoordinateInfoVo"/>
    </select>

    <select id="selectProjectCoordinateInfoById" parameterType="Long" resultMap="ProjectCoordinateInfoResult">
        <include refid="selectProjectCoordinateInfoVo"/>
        where id = #{id}
    </select>

    <insert id="insertProjectCoordinateInfo" parameterType="ProjectCoordinateInfo">
        insert into cons_project_coordinate_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="projectId != null">project_id,</if>
            <if test="strName != null">str_name,</if>
            <if test="da != null">da,</if>
            <if test="df != null">df,</if>
            <if test="dreferenceLatitude != null">dreference_latitude,</if>
            <if test="dcentralMeridian != null">dcentral_meridian,</if>
            <if test="dreferenceLongitude != null">dreference_longitude,</if>
            <if test="dprojectionHeight != null">dprojection_height,</if>
            <if test="projectionName != null">projection_name,</if>
            <if test="heightFittingParameter != null">height_fitting_parameter,</if>
            <if test="constructionP4 != null">construction_p4,</if>
            <if test="createType != null">create_type,</if>
            <if test="projectionId != null">projection_id,</if>
            <if test="constructionP7 != null">construction_p7,</if>
            <if test="projectType != null">project_type,</if>
            <if test="dtx != null">dtx,</if>
            <if test="dty != null">dty,</if>
            <if test="ntype != null">ntype,</if>
            <if test="dtk != null">dtk,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="createTime != null">create_time,</if>
            <if test="createBy != null">create_by,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="tenantId != null">tenant_id,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="projectId != null">#{projectId},</if>
            <if test="strName != null">#{strName},</if>
            <if test="da != null">#{da},</if>
            <if test="df != null">#{df},</if>
            <if test="dreferenceLatitude != null">#{dreferenceLatitude},</if>
            <if test="dcentralMeridian != null">#{dcentralMeridian},</if>
            <if test="dreferenceLongitude != null">#{dreferenceLongitude},</if>
            <if test="dprojectionHeight != null">#{dprojectionHeight},</if>
            <if test="projectionName != null">#{projectionName},</if>
            <if test="heightFittingParameter != null">#{heightFittingParameter},</if>
            <if test="constructionP4 != null">#{constructionP4},</if>
            <if test="createType != null">#{createType},</if>
            <if test="projectionId != null">#{projectionId},</if>
            <if test="constructionP7 != null">#{constructionP7},</if>
            <if test="projectType != null">#{projectType},</if>
            <if test="dtx != null">#{dtx},</if>
            <if test="dty != null">#{dty},</if>
            <if test="ntype != null">#{ntype},</if>
            <if test="dtk != null">#{dtk},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="tenantId != null">#{tenantId},</if>
        </trim>
    </insert>

    <update id="updateProjectCoordinateInfo" parameterType="ProjectCoordinateInfo">
        update cons_project_coordinate_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="projectId != null">project_id = #{projectId},</if>
            <if test="strName != null">str_name = #{strName},</if>
            <if test="da != null">da = #{da},</if>
            <if test="df != null">df = #{df},</if>
            <if test="dreferenceLatitude != null">dreference_latitude = #{dreferenceLatitude},</if>
            <if test="dcentralMeridian != null">dcentral_meridian = #{dcentralMeridian},</if>
            <if test="dreferenceLongitude != null">dreference_longitude = #{dreferenceLongitude},</if>
            <if test="dprojectionHeight != null">dprojection_height = #{dprojectionHeight},</if>
            <if test="projectionName != null">projection_name = #{projectionName},</if>
            <if test="heightFittingParameter != null">height_fitting_parameter = #{heightFittingParameter},</if>
            <if test="constructionP4 != null">construction_p4 = #{constructionP4},</if>
            <if test="createType != null">create_type = #{createType},</if>
            <if test="projectionId != null">projection_id = #{projectionId},</if>
            <if test="constructionP7 != null">construction_p7 = #{constructionP7},</if>
            <if test="projectType != null">project_type = #{projectType},</if>
            <if test="dtx != null">dtx = #{dtx},</if>
            <if test="dty != null">dty = #{dty},</if>
            <if test="ntype != null">ntype = #{ntype},</if>
            <if test="dtk != null">dtk = #{dtk},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="tenantId != null">tenant_id = #{tenantId},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteProjectCoordinateInfoById" parameterType="Long">
        delete
        from cons_project_coordinate_info
        where id = #{id}
    </delete>

    <delete id="deleteProjectCoordinateInfoByIds" parameterType="String">
        delete from cons_project_coordinate_info where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>