<?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.HoleLogMapper">
|
|
<resultMap type="HoleLog" id="HoleLogResult">
|
<result property="id" column="id" />
|
<result property="projectId" column="project_id" />
|
<result property="holeId" column="hole_id" />
|
<result property="code" column="code" />
|
<result property="beginDepth" column="begin_depth" />
|
<result property="endDepth" column="end_depth" />
|
<result property="createTime" column="create_time" />
|
<result property="recordPerson" column="record_person" />
|
<result property="description" column="description" />
|
<result property="isDelete" column="is_delete" />
|
</resultMap>
|
|
<sql id="selectHoleLogVo">
|
select id, project_id, hole_id, code, begin_depth, end_depth, create_time, record_person, description, is_delete from js_hole_log
|
</sql>
|
|
<select id="selectHoleLogList" parameterType="HoleLog" resultMap="HoleLogResult">
|
<include refid="selectHoleLogVo"/>
|
<where>
|
<if test="projectId != null and projectId != ''"> and project_id = #{projectId}</if>
|
<if test="holeId != null and holeId != ''"> and hole_id = #{holeId}</if>
|
<if test="code != null and code != ''"> and code = #{code}</if>
|
<if test="beginDepth != null "> and begin_depth = #{beginDepth}</if>
|
<if test="endDepth != null "> and end_depth = #{endDepth}</if>
|
<if test="recordPerson != null and recordPerson != ''"> and record_person = #{recordPerson}</if>
|
<if test="description != null and description != ''"> and description = #{description}</if>
|
<!-- 开始时间检索 -->
|
<if test="params.beginCreateTime != null and params.beginCreateTime != ''">
|
and date_format(create_time,'%y%m%d') >= date_format(#{params.beginCreateTime},'%y%m%d')
|
</if>
|
<!-- 结束时间检索 -->
|
<if test="params.endCreateTime != null and params.endCreateTime != ''">
|
and date_format(create_time,'%y%m%d') <= date_format(#{params.endCreateTime},'%y%m%d')
|
</if>
|
</where>
|
</select>
|
|
<select id="selectHoleLogById" parameterType="String" resultMap="HoleLogResult">
|
<include refid="selectHoleLogVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertHoleLog" parameterType="HoleLog">
|
insert into js_hole_log
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null and id != ''">id,</if>
|
<if test="projectId != null and projectId != ''">project_id,</if>
|
<if test="holeId != null and holeId != ''">hole_id,</if>
|
<if test="code != null and code != ''">code,</if>
|
<if test="beginDepth != null ">begin_depth,</if>
|
<if test="endDepth != null ">end_depth,</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="isDelete != null and isDelete != ''">is_delete,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null and id != ''">#{id},</if>
|
<if test="projectId != null and projectId != ''">#{projectId},</if>
|
<if test="holeId != null and holeId != ''">#{holeId},</if>
|
<if test="code != null and code != ''">#{code},</if>
|
<if test="beginDepth != null ">#{beginDepth},</if>
|
<if test="endDepth != null ">#{endDepth},</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="isDelete != null and isDelete != ''">#{isDelete},</if>
|
</trim>
|
</insert>
|
|
<update id="updateHoleLog" parameterType="HoleLog">
|
update js_hole_log
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="projectId != null and projectId != ''">project_id = #{projectId},</if>
|
<if test="holeId != null and holeId != ''">hole_id = #{holeId},</if>
|
<if test="code != null and code != ''">code = #{code},</if>
|
<if test="beginDepth != null ">begin_depth = #{beginDepth},</if>
|
<if test="endDepth != null ">end_depth = #{endDepth},</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="isDelete != null and isDelete != ''">is_delete = #{isDelete},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteHoleLogById" parameterType="String">
|
delete from js_hole_log where id = #{id}
|
</delete>
|
|
<delete id="deleteHoleLogByIds" parameterType="String">
|
delete from js_hole_log where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|