<?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.HoleBiaoguanMapper">
|
|
<resultMap type="HoleBiaoguan" id="HoleBiaoguanResult">
|
<result property="ids" column="ids" />
|
<result property="code" column="code" />
|
<result property="projectId" column="project_id" />
|
<result property="holeId" column="hole_id" />
|
<result property="drillLength" column="drill_length" />
|
<result property="begin1" column="begin1" />
|
<result property="end1" column="end1" />
|
<result property="blow1" column="blow1" />
|
<result property="begin2" column="begin2" />
|
<result property="end2" column="end2" />
|
<result property="blow2" column="blow2" />
|
<result property="begin3" column="begin3" />
|
<result property="end3" column="end3" />
|
<result property="blow3" column="blow3" />
|
<result property="begin4" column="begin4" />
|
<result property="end4" column="end4" />
|
<result property="blow4" column="blow4" />
|
<result property="powerType" column="power_type" />
|
<result property="type" column="type" />
|
<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="selectHoleBiaoguanVo">
|
select ids,code, project_id, hole_id, drill_length, begin1, end1, blow1, begin2, end2, blow2, begin3, end3, blow3, begin4, end4, blow4, power_type, type, title, create_time, record_person, description, longitude, latitude, gps_time, is_delete, position, locate_time, reason, pic1, pic2, pic3 from js_hole_biaoguan
|
</sql>
|
|
<select id="selectHoleBiaoguanList" parameterType="HoleBiaoguan" resultMap="HoleBiaoguanResult">
|
SELECT
|
b.ids,
|
b.CODE,
|
b.project_id,
|
b.hole_id,
|
b.drill_length,
|
b.begin1,
|
b.end1,
|
b.blow1,
|
b.begin2,
|
b.end2,
|
b.blow2,
|
b.begin3,
|
b.end3,
|
b.blow3,
|
b.begin4,
|
b.end4,
|
b.blow4,
|
b.power_type,
|
b.type,
|
b.title,
|
b.create_time,
|
b.record_person,
|
u.real_name AS record_person_name,
|
b.description,
|
b.longitude,
|
b.latitude,
|
b.gps_time,
|
b.is_delete,
|
b.position,
|
b.locate_time,
|
b.reason,
|
b.pic1,
|
b.pic2,
|
b.pic3
|
FROM
|
js_hole_biaoguan b LEFT JOIN js_company_user u ON b.record_person = u.ids
|
<where>
|
<if test="projectId != null and projectId != ''"> and b.project_id = #{projectId}</if>
|
<if test="holeId != null and holeId != ''"> and b.hole_id = #{holeId}</if>
|
<if test="drillLength != null and drillLength != ''"> and b.drill_length = #{drillLength}</if>
|
<if test="begin1 != null and begin1 != ''"> and b.begin1 = #{begin1}</if>
|
<if test="end1 != null and end1 != ''"> and b.end1 = #{end1}</if>
|
<if test="blow1 != null and blow1 != ''"> and b.blow1 = #{blow1}</if>
|
<if test="begin2 != null and begin2 != ''"> and b.begin2 = #{begin2}</if>
|
<if test="end2 != null and end2 != ''"> and b.end2 = #{end2}</if>
|
<if test="blow2 != null and blow2 != ''"> and b.blow2 = #{blow2}</if>
|
<if test="begin3 != null and begin3 != ''"> and b.begin3 = #{begin3}</if>
|
<if test="end3 != null and end3 != ''"> and b.end3 = #{end3}</if>
|
<if test="blow3 != null and blow3 != ''"> and b.blow3 = #{blow3}</if>
|
<if test="begin4 != null and begin4 != ''"> and b.begin4 = #{begin4}</if>
|
<if test="end4 != null and end4 != ''"> and b.end4 = #{end4}</if>
|
<if test="blow4 != null and blow4 != ''"> and b.blow4 = #{blow4}</if>
|
<if test="powerType != null and powerType != ''"> and b.power_type = #{powerType}</if>
|
<if test="type != null and type != ''"> and b.type = #{type}</if>
|
<if test="title != null and title != ''"> and b.title = #{title}</if>
|
<if test="recordPerson != null and recordPerson != ''"> and b.record_person = #{recordPerson}</if>
|
<if test="description != null and description != ''"> and b.description = #{description}</if>
|
<if test="longitude != null "> and b.longitude = #{longitude}</if>
|
<if test="latitude != null "> and b.latitude = #{latitude}</if>
|
<if test="gpsTime != null "> and b.gps_time = #{gpsTime}</if>
|
<if test="isDelete != null and isDelete != ''"> and b.is_delete = #{isDelete}</if>
|
<if test="position != null and position != ''"> and b.position = #{position}</if>
|
<if test="locateTime != null "> and b.locate_time = #{locateTime}</if>
|
<if test="reason != null and reason != ''"> and b.reason = #{reason}</if>
|
<if test="pic1 != null and pic1 != ''"> and b.pic1 = #{pic1}</if>
|
<if test="pic2 != null and pic2 != ''"> and b.pic2 = #{pic2}</if>
|
<if test="pic3 != null and pic3 != ''"> and b.pic3 = #{pic3}</if>
|
</where>
|
ORDER BY b.CODE ASC
|
</select>
|
|
<select id="selectHoleBiaoguanById" parameterType="String" resultMap="HoleBiaoguanResult">
|
SELECT
|
b.ids,
|
b.CODE,
|
b.project_id,
|
b.hole_id,
|
b.drill_length,
|
b.begin1,
|
b.end1,
|
b.blow1,
|
b.begin2,
|
b.end2,
|
b.blow2,
|
b.begin3,
|
b.end3,
|
b.blow3,
|
b.begin4,
|
b.end4,
|
b.blow4,
|
b.power_type,
|
b.type,
|
b.title,
|
b.create_time,
|
b.record_person,
|
u.real_name AS record_person_name,
|
b.description,
|
b.longitude,
|
b.latitude,
|
b.gps_time,
|
b.is_delete,
|
b.position,
|
b.locate_time,
|
b.reason,
|
b.pic1,
|
b.pic2,
|
b.pic3
|
FROM
|
js_hole_biaoguan b LEFT JOIN js_company_user u ON b.record_person = u.ids where b.ids = #{ids}
|
</select>
|
|
<select id="countNumberByProjectId" resultType="java.lang.Long">
|
SELECT count(ids) FROM js_hole_biaoguan where project_id = #{projectId} AND type = #{type}
|
</select>
|
|
<select id="selectHoleBiaoguanByHoleId" parameterType="String" resultMap="HoleBiaoguanResult">
|
<include refid="selectHoleBiaoguanVo"/> where hole_id = #{holeId}
|
</select>
|
|
<select id="selectHoleBiaoguanByProjectId" parameterType="String" resultMap="HoleBiaoguanResult">
|
<include refid="selectHoleBiaoguanVo"/> project_id = #{projectId}
|
</select>
|
|
<insert id="insertHoleBiaoguan" parameterType="HoleBiaoguan">
|
insert into js_hole_biaoguan
|
<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="drillLength != null and drillLength != ''">drill_length,</if>
|
<if test="begin1 != null and begin1 != ''">begin1,</if>
|
<if test="end1 != null and end1 != ''">end1,</if>
|
<if test="blow1 != null and blow1 != ''">blow1,</if>
|
<if test="begin2 != null and begin2 != ''">begin2,</if>
|
<if test="end2 != null and end2 != ''">end2,</if>
|
<if test="blow2 != null and blow2 != ''">blow2,</if>
|
<if test="begin3 != null and begin3 != ''">begin3,</if>
|
<if test="end3 != null and end3 != ''">end3,</if>
|
<if test="blow3 != null and blow3 != ''">blow3,</if>
|
<if test="begin4 != null and begin4 != ''">begin4,</if>
|
<if test="end4 != null and end4 != ''">end4,</if>
|
<if test="blow4 != null and blow4 != ''">blow4,</if>
|
<if test="powerType != null and powerType != ''">power_type,</if>
|
<if test="type != null and type != ''">type,</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="drillLength != null and drillLength != ''">#{drillLength},</if>
|
<if test="begin1 != null and begin1 != ''">#{begin1},</if>
|
<if test="end1 != null and end1 != ''">#{end1},</if>
|
<if test="blow1 != null and blow1 != ''">#{blow1},</if>
|
<if test="begin2 != null and begin2 != ''">#{begin2},</if>
|
<if test="end2 != null and end2 != ''">#{end2},</if>
|
<if test="blow2 != null and blow2 != ''">#{blow2},</if>
|
<if test="begin3 != null and begin3 != ''">#{begin3},</if>
|
<if test="end3 != null and end3 != ''">#{end3},</if>
|
<if test="blow3 != null and blow3 != ''">#{blow3},</if>
|
<if test="begin4 != null and begin4 != ''">#{begin4},</if>
|
<if test="end4 != null and end4 != ''">#{end4},</if>
|
<if test="blow4 != null and blow4 != ''">#{blow4},</if>
|
<if test="powerType != null and powerType != ''">#{powerType},</if>
|
<if test="type != null and type != ''">#{type},</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="insertHoleBiaoguanList" parameterType="java.util.List">
|
insert into js_hole_biaoguan
|
(ids,code, project_id, hole_id, drill_length, begin1, end1, blow1, begin2, end2, blow2, begin3, end3, blow3, begin4, end4, blow4, power_type, type, 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.drillLength},#{item.begin1},#{item.end1},#{item.blow1},#{item.begin2},#{item.end2},#{item.blow2},#{item.begin3},#{item.end3},#{item.blow3},#{item.begin4},#{item.end4},#{item.blow4},#{item.powerType},#{item.type},
|
#{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="updateHoleBiaoguan" parameterType="HoleBiaoguan">
|
update js_hole_biaoguan
|
<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="drillLength != null and drillLength != ''">drill_length = #{drillLength},</if>
|
<if test="begin1 != null and begin1 != ''">begin1 = #{begin1},</if>
|
<if test="end1 != null and end1 != ''">end1 = #{end1},</if>
|
<if test="blow1 != null and blow1 != ''">blow1 = #{blow1},</if>
|
<if test="begin2 != null and begin2 != ''">begin2 = #{begin2},</if>
|
<if test="end2 != null and end2 != ''">end2 = #{end2},</if>
|
<if test="blow2 != null and blow2 != ''">blow2 = #{blow2},</if>
|
<if test="begin3 != null and begin3 != ''">begin3 = #{begin3},</if>
|
<if test="end3 != null and end3 != ''">end3 = #{end3},</if>
|
<if test="blow3 != null and blow3 != ''">blow3 = #{blow3},</if>
|
<if test="begin4 != null and begin4 != ''">begin4 = #{begin4},</if>
|
<if test="end4 != null and end4 != ''">end4 = #{end4},</if>
|
<if test="blow4 != null and blow4 != ''">blow4 = #{blow4},</if>
|
<if test="powerType != null and powerType != ''">power_type = #{powerType},</if>
|
<if test="type != null and type != ''">type = #{type},</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="deleteHoleBiaoguanById" parameterType="String">
|
delete from js_hole_biaoguan where ids = #{ids}
|
</delete>
|
|
<delete id="deleteHoleBiaoguanByIds" parameterType="String">
|
delete from js_hole_biaoguan where ids in
|
<foreach item="ids" collection="array" open="(" separator="," close=")">
|
#{ids}
|
</foreach>
|
</delete>
|
|
</mapper>
|