<?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.javaweb.geo.mapper.HoleMapper">
|
|
<resultMap type="Hole" id="HoleResult">
|
<result property="ids" column="ids" />
|
<result property="projectId" column="project_id" />
|
<result property="code" column="code" />
|
<result property="createTime" column="create_time" />
|
<result property="updateTime" column="update_time" />
|
<result property="description" column="description" />
|
<result property="type" column="type" />
|
<result property="elevation" column="elevation" />
|
<result property="depth" column="depth" />
|
<result property="longitude" column="longitude" />
|
<result property="latitude" column="latitude" />
|
<result property="surveyX" column="survey_x" />
|
<result property="surveyY" column="survey_y" />
|
<result property="surveyZ" column="survey_z" />
|
<result property="surveyLatitude" column="survey_latitude" />
|
<result property="surveyLongitude" column="survey_longitude" />
|
<result property="mapLatitude" column="map_latitude" />
|
<result property="mapLongitude" column="map_longitude" />
|
<result property="mapTime" column="map_time" />
|
<result property="position" column="position" />
|
<result property="locateTime" column="locate_time" />
|
<result property="reason" column="reason" />
|
<result property="pic1" column="pic1" />
|
<result property="pic2" column="pic2" />
|
<result property="pic3" column="pic3" />
|
<result property="status" column="status" />
|
<result property="isDeleted" column="is_deleted" />
|
<result property="isFlag" column="is_flag" />
|
</resultMap>
|
|
<sql id="selectHoleVo">
|
select ids, project_id, code, create_time, update_time, description, type, elevation, depth, longitude, latitude, survey_x, survey_y, survey_z, survey_latitude, survey_longitude, map_latitude, map_longitude, map_time, position, locate_time, reason, pic1, pic2, pic3, status, is_deleted, is_flag from js_hole
|
</sql>
|
|
<select id="selectHoleList" parameterType="Hole" resultMap="HoleResult">
|
<include refid="selectHoleVo"/>
|
<where>
|
<if test="projectId != null and projectId != ''"> and project_id = #{projectId}</if>
|
<if test="code != null and code != ''"> and code = #{code}</if>
|
<if test="description != null and description != ''"> and description = #{description}</if>
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
<if test="elevation != null and elevation != ''"> and elevation = #{elevation}</if>
|
<if test="depth != null "> and depth = #{depth}</if>
|
<if test="longitude != null "> and longitude = #{longitude}</if>
|
<if test="latitude != null "> and latitude = #{latitude}</if>
|
<if test="surveyX != null "> and survey_x = #{surveyX}</if>
|
<if test="surveyY != null "> and survey_y = #{surveyY}</if>
|
<if test="surveyZ != null "> and survey_z = #{surveyZ}</if>
|
<if test="surveyLatitude != null "> and survey_latitude = #{surveyLatitude}</if>
|
<if test="surveyLongitude != null "> and survey_longitude = #{surveyLongitude}</if>
|
<if test="mapLatitude != null and mapLatitude != ''"> and map_latitude = #{mapLatitude}</if>
|
<if test="mapLongitude != null and mapLongitude != ''"> and map_longitude = #{mapLongitude}</if>
|
<if test="mapTime != null "> and map_time = #{mapTime}</if>
|
<if test="position != null and position != ''"> and position = #{position}</if>
|
<if test="locateTime != null "> and locate_time = #{locateTime}</if>
|
<if test="reason != null and reason != ''"> and reason = #{reason}</if>
|
<if test="pic1 != null and pic1 != ''"> and pic1 = #{pic1}</if>
|
<if test="pic2 != null and pic2 != ''"> and pic2 = #{pic2}</if>
|
<if test="pic3 != null and pic3 != ''"> and pic3 = #{pic3}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="isDeleted != null and isDeleted != ''"> and is_deleted = #{isDeleted}</if>
|
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
|
</where>
|
</select>
|
|
<select id="selectHoleById" parameterType="String" resultMap="HoleResult">
|
<include refid="selectHoleVo"/>
|
where ids = #{ids}
|
</select>
|
|
<select id="selectHoleNumByProjectId" parameterType="String" resultType="int">
|
select count(ids) from js_hole where project_id = #{projectId}
|
</select>
|
|
<select id="selectHoleBySerNum" resultMap="HoleResult">
|
|
<include refid="selectHoleVo"/>
|
where project_id = #{projectId} and code =#{code}
|
</select>
|
|
<select id="selectHoleNum" resultType="java.lang.Long">
|
SELECT count(ids) FROM js_hole WHERE is_deleted = '0' AND project_id = any(SELECT ids FROM js_project WHERE `status` = '0' AND is_deleted = '0')
|
</select>
|
|
<select id="selectAllHoleNum" resultType="java.lang.Long">
|
SELECT count(ids) FROM js_hole WHERE is_deleted = '0'
|
</select>
|
|
<select id="selectHoleListByFlag0" resultMap="HoleResult">
|
<include refid="selectHoleVo"/> WHERE is_deleted = '0' and is_flag = '0'
|
</select>
|
|
<select id="selectHoleByProjectId" parameterType="String" resultMap="HoleResult">
|
<include refid="selectHoleVo"/> WHERE project_id = #{projectId}
|
</select>
|
|
<insert id="insertHole" parameterType="Hole">
|
insert into js_hole
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="ids != null and ids != ''">ids,</if>
|
<if test="projectId != null and projectId != ''">project_id,</if>
|
<if test="code != null and code != ''">code,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="description != null and description != ''">description,</if>
|
<if test="type != null and type != ''">type,</if>
|
<if test="elevation != null and elevation != ''">elevation,</if>
|
<if test="depth != null ">depth,</if>
|
<if test="longitude != null ">longitude,</if>
|
<if test="latitude != null ">latitude,</if>
|
<if test="surveyX != null ">survey_x,</if>
|
<if test="surveyY != null ">survey_y,</if>
|
<if test="surveyZ != null ">survey_z,</if>
|
<if test="surveyLatitude != null ">survey_latitude,</if>
|
<if test="surveyLongitude != null ">survey_longitude,</if>
|
<if test="mapLatitude != null and mapLatitude != ''">map_latitude,</if>
|
<if test="mapLongitude != null and mapLongitude != ''">map_longitude,</if>
|
<if test="mapTime != null ">map_time,</if>
|
<if test="position != null and position != ''">position,</if>
|
<if test="locateTime != null ">locate_time,</if>
|
<if test="reason != null and reason != ''">reason,</if>
|
<if test="pic1 != null and pic1 != ''">pic1,</if>
|
<if test="pic2 != null and pic2 != ''">pic2,</if>
|
<if test="pic3 != null and pic3 != ''">pic3,</if>
|
<if test="status != null and status != ''">status,</if>
|
<if test="isDeleted != null and isDeleted != ''">is_deleted,</if>
|
<if test="isFlag != null and isFlag != ''">is_flag,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="ids != null and ids != ''">#{ids},</if>
|
<if test="projectId != null and projectId != ''">#{projectId},</if>
|
<if test="code != null and code != ''">#{code},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="description != null and description != ''">#{description},</if>
|
<if test="type != null and type != ''">#{type},</if>
|
<if test="elevation != null and elevation != ''">#{elevation},</if>
|
<if test="depth != null ">#{depth},</if>
|
<if test="longitude != null ">#{longitude},</if>
|
<if test="latitude != null ">#{latitude},</if>
|
<if test="surveyX != null ">#{surveyX},</if>
|
<if test="surveyY != null ">#{surveyY},</if>
|
<if test="surveyZ != null ">#{surveyZ},</if>
|
<if test="surveyLatitude != null ">#{surveyLatitude},</if>
|
<if test="surveyLongitude != null ">#{surveyLongitude},</if>
|
<if test="mapLatitude != null and mapLatitude != ''">#{mapLatitude},</if>
|
<if test="mapLongitude != null and mapLongitude != ''">#{mapLongitude},</if>
|
<if test="mapTime != null ">#{mapTime},</if>
|
<if test="position != null and position != ''">#{position},</if>
|
<if test="locateTime != null ">#{locateTime},</if>
|
<if test="reason != null and reason != ''">#{reason},</if>
|
<if test="pic1 != null and pic1 != ''">#{pic1},</if>
|
<if test="pic2 != null and pic2 != ''">#{pic2},</if>
|
<if test="pic3 != null and pic3 != ''">#{pic3},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
<if test="isDeleted != null and isDeleted != ''">#{isDeleted},</if>
|
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
|
</trim>
|
</insert>
|
|
<update id="updateHole" parameterType="Hole">
|
update js_hole
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="projectId != null and projectId != ''">project_id = #{projectId},</if>
|
<if test="code != null and code != ''">code = #{code},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="description != null and description != ''">description = #{description},</if>
|
<if test="type != null and type != ''">type = #{type},</if>
|
<if test="elevation != null and elevation != ''">elevation = #{elevation},</if>
|
<if test="depth != null ">depth = #{depth},</if>
|
<if test="longitude != null ">longitude = #{longitude},</if>
|
<if test="latitude != null ">latitude = #{latitude},</if>
|
<if test="surveyX != null ">survey_x = #{surveyX},</if>
|
<if test="surveyY != null ">survey_y = #{surveyY},</if>
|
<if test="surveyZ != null ">survey_z = #{surveyZ},</if>
|
<if test="surveyLatitude != null ">survey_latitude = #{surveyLatitude},</if>
|
<if test="surveyLongitude != null ">survey_longitude = #{surveyLongitude},</if>
|
<if test="mapLatitude != null and mapLatitude != ''">map_latitude = #{mapLatitude},</if>
|
<if test="mapLongitude != null and mapLongitude != ''">map_longitude = #{mapLongitude},</if>
|
<if test="mapTime != null ">map_time = #{mapTime},</if>
|
<if test="position != null and position != ''">position = #{position},</if>
|
<if test="locateTime != null ">locate_time = #{locateTime},</if>
|
<if test="reason != null and reason != ''">reason = #{reason},</if>
|
<if test="pic1 != null and pic1 != ''">pic1 = #{pic1},</if>
|
<if test="pic2 != null and pic2 != ''">pic2 = #{pic2},</if>
|
<if test="pic3 != null and pic3 != ''">pic3 = #{pic3},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="isDeleted != null and isDeleted != ''">is_deleted = #{isDeleted},</if>
|
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
|
</trim>
|
where ids = #{ids}
|
</update>
|
|
<delete id="deleteHoleById" parameterType="String">
|
delete from js_hole where ids = #{ids}
|
</delete>
|
|
<delete id="deleteHoleByIds" parameterType="String">
|
delete from js_hole where ids in
|
<foreach item="ids" collection="array" open="(" separator="," close=")">
|
#{ids}
|
</foreach>
|
</delete>
|
|
</mapper>
|