<?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.platform.mapper.ProjectApplyHoleMapper">
|
|
<resultMap type="ProjectApplyHole" id="ProjectApplyHoleResult">
|
<result property="id" column="id" />
|
<result property="applyId" column="apply_id" />
|
<result property="holeId" column="hole_id" />
|
<result property="userId" column="user_id" />
|
<result property="status" column="status" />
|
<result property="createTime" column="create_time" />
|
<result property="overTime" column="over_time" />
|
<result property="holeType" column="hole_type" />
|
</resultMap>
|
|
<resultMap type="ProjectApplyHole" id="ProjectApplyHoleResult2">
|
<result property="id" column="id" />
|
<result property="applyId" column="apply_id" />
|
<result property="holeId" column="hole_id" />
|
<result property="userId" column="user_id" />
|
<result property="status" column="status" />
|
<result property="createTime" column="create_time" />
|
<result property="overTime" column="over_time" />
|
<result property="projNo" column="proj_no" />
|
<result property="holeNo" column="hole_no" />
|
<result property="holeType" column="hole_type" />
|
<result property="holeDepth" column="hole_depth" />
|
<result property="longitude" column="longitude" />
|
<result property="latitude" column="latitude" />
|
</resultMap>
|
|
<sql id="selectProjectApplyHoleVo">
|
select id, apply_id, hole_id, user_id, status, create_time, over_time,hole_type from js_project_apply_hole
|
</sql>
|
|
<sql id="selectProjectApplyHoleVo2">
|
select a.id, a.apply_id, a.hole_id, a.user_id, a.status, a.create_time, a.over_time,
|
b.proj_no, b.hole_no,b.hole_type, b.hole_depth ,b.longitude,b.latitude
|
from js_project_apply_hole a join js_hole_info b on a.hole_id =b.id
|
</sql>
|
|
<select id="selectProjectApplyHoleList" parameterType="ProjectApplyHole" resultMap="ProjectApplyHoleResult">
|
<include refid="selectProjectApplyHoleVo"/>
|
<where>
|
<if test="applyId != null and applyId != ''"> and apply_id = #{applyId}</if>
|
<if test="holeId != null and holeId != ''"> and hole_id = #{holeId}</if>
|
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="overTime != null "> and over_time = #{overTime}</if>
|
</where>
|
</select>
|
|
<select id="selectProjectApplyHoleListJoinHoleInfo" parameterType="ProjectApplyHole" resultMap="ProjectApplyHoleResult2">
|
<include refid="selectProjectApplyHoleVo2"/>
|
<where>
|
<if test="applyId != null and applyId != ''"> and apply_id = #{applyId}</if>
|
<if test="holeId != null and holeId != ''"> and hole_id = #{holeId}</if>
|
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="overTime != null "> and over_time = #{overTime}</if>
|
</where>
|
</select>
|
|
|
<select id="selectProjectApplyHoleById" parameterType="String" resultMap="ProjectApplyHoleResult">
|
<include refid="selectProjectApplyHoleVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertProjectApplyHole" parameterType="ProjectApplyHole">
|
insert into js_project_apply_hole
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null and id != ''">id,</if>
|
<if test="applyId != null and applyId != ''">apply_id,</if>
|
<if test="holeId != null and holeId != ''">hole_id,</if>
|
<if test="userId != null ">user_id,</if>
|
<if test="status != null and status != ''">status,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="overTime != null ">over_time,</if>
|
<if test="holeType != null and holeType != ''">hole_type,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null and id != ''">#{id},</if>
|
<if test="applyId != null and applyId != ''">#{applyId},</if>
|
<if test="holeId != null and holeId != ''">#{holeId},</if>
|
<if test="userId != null ">#{userId},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="overTime != null ">#{overTime},</if>
|
<if test="holeType != null and holeType != ''">#{holeType},</if>
|
</trim>
|
</insert>
|
|
<update id="updateProjectApplyHole" parameterType="ProjectApplyHole">
|
update js_project_apply_hole
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="applyId != null and applyId != ''">apply_id = #{applyId},</if>
|
<if test="holeId != null and holeId != ''">hole_id = #{holeId},</if>
|
<if test="userId != null ">user_id = #{userId},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="overTime != null ">over_time = #{overTime},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="updateProjectApplyStatus" parameterType="ProjectApplyHole">
|
update js_project_apply_hole set status = #{status} where apply_id = #{applyId}
|
</update>
|
|
<delete id="deleteProjectApplyHoleById" parameterType="String">
|
delete from js_project_apply_hole where id = #{id}
|
</delete>
|
|
<delete id="deleteProjectApplyHoleByIds" parameterType="String">
|
delete from js_project_apply_hole where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|