<?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.HandleExceptionMapper">
|
|
<resultMap type="HandleException" id="HandleExceptionResult">
|
<result property="ids" column="ids" />
|
<result property="companyId" column="company_id" />
|
<result property="description" column="description" />
|
<result property="handleStatus" column="handle_status" />
|
<result property="holeCode" column="hole_code" />
|
<result property="holeId" column="hole_id" />
|
<result property="level" column="level" />
|
<result property="mapTime" column="map_time" />
|
<result property="projectId" column="project_id" />
|
<result property="projectName" column="project_name" />
|
<result property="type" column="type" />
|
<result property="isDelete" column="is_delete" />
|
</resultMap>
|
|
<sql id="selectHandleExceptionVo">
|
select ids, company_id, description, handle_status, hole_code, hole_id, level, map_time, project_id, type, is_delete from js_handle_exception
|
</sql>
|
|
<select id="selectHandleExceptionList" parameterType="HandleException" resultMap="HandleExceptionResult">
|
select
|
e.ids,
|
e.company_id,
|
e.description,
|
e.handle_status,
|
e.hole_code,
|
e.hole_id,
|
e.`level`,
|
e.map_time,
|
e.project_id,
|
p.full_name as project_name,
|
e.type,
|
e.is_delete
|
FROM
|
js_handle_exception e
|
LEFT JOIN js_project p ON e.project_id = p.ids
|
<where>
|
e.is_delete='0'
|
<if test="companyId != null and companyId != ''"> and e.company_id = #{companyId}</if>
|
<if test="description != null and description != ''"> and e.description = #{description}</if>
|
<if test="handleStatus != null and handleStatus != ''"> and e.handle_status = #{handleStatus}</if>
|
<if test="holeCode != null and holeCode != ''"> and e.hole_code = #{holeCode}</if>
|
<if test="holeId != null and holeId != ''"> and e.hole_id = #{holeId}</if>
|
<if test="level != null and level != ''"> and e.level = #{level}</if>
|
<if test="mapTime != null "> and e.map_time = #{mapTime}</if>
|
<if test="projectId != null and projectId != ''"> and e.project_id = #{projectId}</if>
|
<if test="projectName != null and projectName != ''"> and p.full_name like concat('%', #{projectName}, '%')</if>
|
<if test="type != null and type != ''"> and e.type = #{type}</if>
|
<if test="isDelete != null and isDelete != ''"> and e.is_delete = #{isDelete}</if>
|
</where>
|
</select>
|
|
<select id="selectHandleExceptionById" parameterType="String" resultMap="HandleExceptionResult">
|
<include refid="selectHandleExceptionVo"/>
|
where ids = #{ids}
|
</select>
|
|
<select id="selectAllExceptionNum" resultType="java.lang.Long">
|
SELECT count(ids) FROM js_handle_exception WHERE is_delete = '0'
|
</select>
|
|
<select id="selectExceptionNum" resultType="java.lang.Long">
|
SELECT count(ids) FROM js_handle_exception WHERE is_delete = '0' AND project_id = any(SELECT ids FROM js_project WHERE `status` = '0' AND is_deleted = '0')
|
</select>
|
|
<select id="selectListByProjectId" parameterType="String" resultMap="HandleExceptionResult">
|
<include refid="selectHandleExceptionVo"/> WHERE is_delete = '0' AND project_id = #{projectId} ORDER BY map_time ASC
|
</select>
|
<select id="selectListByHoleId" parameterType="String" resultMap="HandleExceptionResult">
|
<include refid="selectHandleExceptionVo"/> WHERE is_delete = '0' AND hole_id = #{holeId} ORDER BY map_time ASC
|
</select>
|
|
<select id="selectExceptionNumByCompanyId" resultType="java.lang.Integer">
|
select count(ids) from js_handle_exception where company_id = #{companyId}
|
</select>
|
|
<select id="selectExceptionNumByProjectId" resultType="java.lang.Integer">
|
select count(ids) from js_handle_exception where project_id = #{projectId}
|
</select>
|
|
<insert id="insertHandleException" parameterType="HandleException">
|
insert into js_handle_exception
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="ids != null and ids != ''">ids,</if>
|
<if test="companyId != null and companyId != ''">company_id,</if>
|
<if test="description != null and description != ''">description,</if>
|
<if test="handleStatus != null and handleStatus != ''">handle_status,</if>
|
<if test="holeCode != null and holeCode != ''">hole_code,</if>
|
<if test="holeId != null and holeId != ''">hole_id,</if>
|
<if test="level != null and level != ''">level,</if>
|
<if test="mapTime != null ">map_time,</if>
|
<if test="projectId != null and projectId != ''">project_id,</if>
|
<if test="type != null and type != ''">type,</if>
|
<if test="isDelete != null and isDelete != ''">is_delete,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="ids != null and ids != ''">#{ids},</if>
|
<if test="companyId != null and companyId != ''">#{companyId},</if>
|
<if test="description != null and description != ''">#{description},</if>
|
<if test="handleStatus != null and handleStatus != ''">#{handleStatus},</if>
|
<if test="holeCode != null and holeCode != ''">#{holeCode},</if>
|
<if test="holeId != null and holeId != ''">#{holeId},</if>
|
<if test="level != null and level != ''">#{level},</if>
|
<if test="mapTime != null ">#{mapTime},</if>
|
<if test="projectId != null and projectId != ''">#{projectId},</if>
|
<if test="type != null and type != ''">#{type},</if>
|
<if test="isDelete != null and isDelete != ''">#{isDelete},</if>
|
</trim>
|
</insert>
|
|
<update id="updateHandleException" parameterType="HandleException">
|
update js_handle_exception
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
<if test="description != null and description != ''">description = #{description},</if>
|
<if test="handleStatus != null and handleStatus != ''">handle_status = #{handleStatus},</if>
|
<if test="holeCode != null and holeCode != ''">hole_code = #{holeCode},</if>
|
<if test="holeId != null and holeId != ''">hole_id = #{holeId},</if>
|
<if test="level != null and level != ''">level = #{level},</if>
|
<if test="mapTime != null ">map_time = #{mapTime},</if>
|
<if test="projectId != null and projectId != ''">project_id = #{projectId},</if>
|
<if test="type != null and type != ''">type = #{type},</if>
|
<if test="isDelete != null and isDelete != ''">is_delete = #{isDelete},</if>
|
</trim>
|
where ids = #{ids}
|
</update>
|
|
<delete id="deleteHandleExceptionById" parameterType="String">
|
delete from js_handle_exception where ids = #{ids}
|
</delete>
|
|
<delete id="deleteHandleExceptionByIds" parameterType="String">
|
delete from js_handle_exception where ids in
|
<foreach item="ids" collection="array" open="(" separator="," close=")">
|
#{ids}
|
</foreach>
|
</delete>
|
|
</mapper>
|