<?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.HoleShuiweiMapper">
|
|
<resultMap type="HoleShuiwei" id="HoleShuiweiResult">
|
<result property="ids" column="ids" />
|
<result property="code" column="code" />
|
<result property="projectId" column="project_id" />
|
<result property="holeId" column="hole_id" />
|
<result property="type" column="type" />
|
<result property="waterType" column="water_type" />
|
<result property="shownWaterLevel" column="shown_water_level" />
|
<result property="stillWaterLevel" column="still_water_level" />
|
<result property="shownTime" column="shown_time" />
|
<result property="stillTime" column="still_time" />
|
<result property="waterDepth" column="water_depth" />
|
<result property="getMode" column="get_mode" />
|
<result property="title" column="title" />
|
<result property="createTime" column="create_time" />
|
<result property="recordPerson" column="record_person" />
|
<result property="recordPersonName" column="record_person_name" />
|
<result property="description" column="description" />
|
<result property="longitude" column="longitude" />
|
<result property="latitude" column="latitude" />
|
<result property="gpsTime" column="gps_time" />
|
<result property="isDelete" column="is_delete" />
|
<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" />
|
<!--select子查询, column 传给子查询的参数-->
|
<!-- <collection property="holeMediaList" ofType="com.javaweb.geo.domain.HoleMedia" select="queryDetail" column="ids" />-->
|
</resultMap>
|
|
<resultMap type="HoleMedia" id="HoleMediaResult">
|
<result property="ids" column="ids" />
|
<result property="recordId" column="record_id" />
|
<result property="projectId" column="project_id" />
|
<result property="name" column="name" />
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP" />
|
<result property="type" column="type" />
|
<result property="internetPath" column="internet_path" />
|
<result property="createUser" column="create_user" />
|
<result property="uploadUser" column="upload_user" />
|
</resultMap>
|
|
<!--子查询的sql-->
|
<select id="queryDetail" resultMap="HoleMediaResult">
|
SELECT * FROM js_hole_media where record_id = #{ids}
|
</select>
|
|
<sql id="selectHoleShuiweiVo">
|
select ids,code, project_id, hole_id, type, water_type, shown_water_level, still_water_level, shown_time, still_time, water_depth, get_mode, title, create_time, record_person, description, longitude, latitude, gps_time, is_delete, position, locate_time, reason, pic1, pic2, pic3 from js_hole_shuiwei
|
</sql>
|
|
<select id="selectHoleShuiweiList" parameterType="HoleShuiwei" resultMap="HoleShuiweiResult">
|
select
|
a.ids,
|
a.code,
|
a.project_id,
|
a.hole_id,
|
a.type,
|
a.water_type,
|
a.shown_water_level,
|
a.still_water_level,
|
a.shown_time,
|
a.still_time,
|
a.water_depth,
|
a.get_mode,
|
a.title,
|
a.create_time,
|
a.record_person,
|
u.real_name AS record_person_name,
|
a.description,
|
a.longitude,
|
a.latitude,
|
a.gps_time,
|
a.is_delete,
|
a.position,
|
a.locate_time,
|
a.reason,
|
a.pic1,
|
a.pic2,
|
a. pic3
|
from js_hole_shuiwei a LEFT JOIN js_company_user u ON a.record_person = u.ids
|
<where>
|
<if test="code != null and code != ''"> and a.code = #{code}</if>
|
<if test="projectId != null and projectId != ''"> and a.project_id = #{projectId}</if>
|
<if test="holeId != null and holeId != ''"> and a.hole_id = #{holeId}</if>
|
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
<if test="waterType != null and waterType != ''"> and a.water_type = #{waterType}</if>
|
<if test="shownWaterLevel != null "> and a.shown_water_level = #{shownWaterLevel}</if>
|
<if test="stillWaterLevel != null "> and a.still_water_level = #{stillWaterLevel}</if>
|
<if test="shownTime != null and shownTime != ''"> and a.shown_time = #{shownTime}</if>
|
<if test="stillTime != null and stillTime != ''"> and a.still_time = #{stillTime}</if>
|
<if test="waterDepth != null "> and a.water_depth = #{waterDepth}</if>
|
<if test="getMode != null and getMode != ''"> and a.get_mode = #{getMode}</if>
|
<if test="title != null and title != ''"> and a.title = #{title}</if>
|
<if test="recordPerson != null and recordPerson != ''"> and a.record_person = #{recordPerson}</if>
|
<if test="description != null and description != ''"> and a.description = #{description}</if>
|
<if test="longitude != null "> and a.longitude = #{longitude}</if>
|
<if test="latitude != null "> and a.latitude = #{latitude}</if>
|
<if test="gpsTime != null "> and a.gps_time = #{gpsTime}</if>
|
<if test="isDelete != null and isDelete != ''"> and a.is_delete = #{isDelete}</if>
|
<if test="position != null and position != ''"> and a.position = #{position}</if>
|
<if test="locateTime != null "> and a.locate_time = #{locateTime}</if>
|
<if test="reason != null and reason != ''"> and reason = #{reason}</if>
|
<if test="pic1 != null and pic1 != ''"> and a.pic1 = #{pic1}</if>
|
<if test="pic2 != null and pic2 != ''"> and a.pic2 = #{pic2}</if>
|
<if test="pic3 != null and pic3 != ''"> and a.pic3 = #{pic3}</if>
|
</where>
|
ORDER BY a.code ASC
|
</select>
|
|
<select id="selectHoleShuiweiById" parameterType="String" resultMap="HoleShuiweiResult">
|
select
|
a.ids,
|
a.code,
|
a.project_id,
|
a.hole_id,
|
a.type,
|
a.water_type,
|
a.shown_water_level,
|
a.still_water_level,
|
a.shown_time,
|
a.still_time,
|
a.water_depth,
|
a.get_mode,
|
a.title,
|
a.create_time,
|
a.record_person,
|
a.description,
|
a.longitude,
|
a.latitude,
|
a.gps_time,
|
a.is_delete,
|
a.position,
|
a.locate_time,
|
a.reason,
|
a.pic1,
|
a.pic2,
|
a. pic3
|
from js_hole_shuiwei a LEFT JOIN js_company_user u ON a.record_person = u.ids
|
where a.ids = #{ids}
|
</select>
|
|
<select id="countNumberByProjectId" resultType="java.lang.Long">
|
SELECT count(ids) FROM js_hole_shuiwei where project_id = #{projectId} AND type = #{type}
|
</select>
|
<select id="selectHoleShuiWeiByHoleId" parameterType="String" resultMap="HoleShuiweiResult">
|
<include refid="selectHoleShuiweiVo"/> where hole_id = #{holeId}
|
</select>
|
|
<select id="selectHoleShuiWeiByProjectId" resultType="com.javaweb.geo.domain.HoleShuiwei">
|
<include refid="selectHoleShuiweiVo"/> WHERE project_id = #{projectId}
|
</select>
|
|
<insert id="insertHoleShuiwei" parameterType="HoleShuiwei">
|
insert into js_hole_shuiwei
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="ids != null and ids != ''">ids,</if>
|
<if test="code != null and code != ''">code,</if>
|
<if test="projectId != null and projectId != ''">project_id,</if>
|
<if test="holeId != null and holeId != ''">hole_id,</if>
|
<if test="type != null and type != ''">type,</if>
|
<if test="waterType != null and waterType != ''">water_type,</if>
|
<if test="shownWaterLevel != null ">shown_water_level,</if>
|
<if test="stillWaterLevel != null ">still_water_level,</if>
|
<if test="shownTime != null and shownTime != ''">shown_time,</if>
|
<if test="stillTime != null and stillTime != ''">still_time,</if>
|
<if test="waterDepth != null ">water_depth,</if>
|
<if test="getMode != null and getMode != ''">get_mode,</if>
|
<if test="title != null and title != ''">title,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="recordPerson != null and recordPerson != ''">record_person,</if>
|
<if test="description != null and description != ''">description,</if>
|
<if test="longitude != null ">longitude,</if>
|
<if test="latitude != null ">latitude,</if>
|
<if test="gpsTime != null ">gps_time,</if>
|
<if test="isDelete != null and isDelete != ''">is_delete,</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>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="ids != null and ids != ''">#{ids},</if>
|
<if test="code != null and code != ''">#{code},</if>
|
<if test="projectId != null and projectId != ''">#{projectId},</if>
|
<if test="holeId != null and holeId != ''">#{holeId},</if>
|
<if test="type != null and type != ''">#{type},</if>
|
<if test="waterType != null and waterType != ''">#{waterType},</if>
|
<if test="shownWaterLevel != null ">#{shownWaterLevel},</if>
|
<if test="stillWaterLevel != null ">#{stillWaterLevel},</if>
|
<if test="shownTime != null and shownTime != ''">#{shownTime},</if>
|
<if test="stillTime != null and stillTime != ''">#{stillTime},</if>
|
<if test="waterDepth != null ">#{waterDepth},</if>
|
<if test="getMode != null and getMode != ''">#{getMode},</if>
|
<if test="title != null and title != ''">#{title},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="recordPerson != null and recordPerson != ''">#{recordPerson},</if>
|
<if test="description != null and description != ''">#{description},</if>
|
<if test="longitude != null ">#{longitude},</if>
|
<if test="latitude != null ">#{latitude},</if>
|
<if test="gpsTime != null ">#{gpsTime},</if>
|
<if test="isDelete != null and isDelete != ''">#{isDelete},</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>
|
</trim>
|
</insert>
|
|
<insert id="insertHoleShuiweiList" parameterType="java.util.List">
|
insert into js_hole_shuiwei
|
(ids,code, project_id, hole_id, type, water_type, shown_water_level, still_water_level, shown_time, still_time, water_depth, get_mode, title, create_time, record_person, description, longitude, latitude, gps_time, is_delete, position, locate_time, reason, pic1, pic2, pic3)
|
VALUES
|
<foreach collection="list" item="item" separator =",">
|
(#{item.ids}, #{item.code}, #{item.projectId},#{item.holeId},#{item.type},#{item.waterType},#{item.shownWaterLevel},#{item.stillWaterLevel},#{item.shownTime},#{item.stillTime},#{item.waterDepth},#{item.getMode},
|
#{item.title},#{item.createTime},#{item.recordPerson},#{item.description},#{item.longitude},#{item.latitude},#{item.gpsTime},#{item.isDelete},#{item.position},#{item.locateTime},#{item.reason},#{item.pic1},#{item.pic2},#{item.pic3})
|
</foreach >
|
</insert>
|
|
<update id="updateHoleShuiwei" parameterType="HoleShuiwei">
|
update js_hole_shuiwei
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="code != null and code != ''">code = #{code},</if>
|
<if test="projectId != null and projectId != ''">project_id = #{projectId},</if>
|
<if test="holeId != null and holeId != ''">hole_id = #{holeId},</if>
|
<if test="type != null and type != ''">type = #{type},</if>
|
<if test="waterType != null and waterType != ''">water_type = #{waterType},</if>
|
<if test="shownWaterLevel != null ">shown_water_level = #{shownWaterLevel},</if>
|
<if test="stillWaterLevel != null ">still_water_level = #{stillWaterLevel},</if>
|
<if test="shownTime != null and shownTime != ''">shown_time = #{shownTime},</if>
|
<if test="stillTime != null and stillTime != ''">still_time = #{stillTime},</if>
|
<if test="waterDepth != null ">water_depth = #{waterDepth},</if>
|
<if test="getMode != null and getMode != ''">get_mode = #{getMode},</if>
|
<if test="title != null and title != ''">title = #{title},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="recordPerson != null and recordPerson != ''">record_person = #{recordPerson},</if>
|
<if test="description != null and description != ''">description = #{description},</if>
|
<if test="longitude != null ">longitude = #{longitude},</if>
|
<if test="latitude != null ">latitude = #{latitude},</if>
|
<if test="gpsTime != null ">gps_time = #{gpsTime},</if>
|
<if test="isDelete != null and isDelete != ''">is_delete = #{isDelete},</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>
|
</trim>
|
where ids = #{ids}
|
</update>
|
|
<delete id="deleteHoleShuiweiById" parameterType="String">
|
delete from js_hole_shuiwei where ids = #{ids}
|
</delete>
|
|
<delete id="deleteHoleShuiweiByIds" parameterType="String">
|
delete from js_hole_shuiwei where ids in
|
<foreach item="ids" collection="array" open="(" separator="," close=")">
|
#{ids}
|
</foreach>
|
</delete>
|
|
</mapper>
|