<?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.ProjectInfoMapper">
|
|
<resultMap type="ProjectInfo" id="ProjectInfoResult">
|
<result property="id" column="id" />
|
<result property="projectNo" column="project_no" />
|
<result property="projectName" column="project_name" />
|
<result property="constructionUnit" column="construction_unit" />
|
<result property="exprorationUnit" column="exproration_unit" />
|
<result property="serviceUnit" column="service_unit" />
|
<result property="addressCode" column="address_code" />
|
<result property="address" column="address" />
|
<result property="projectLeader" column="project_leader" />
|
<result property="projectEnginer" column="project_enginer" />
|
<result property="startTime" column="start_time" />
|
<result property="plannedTime" column="planned_time" />
|
<result property="endTime" column="end_time" />
|
<result property="projectPicture" column="project_picture" />
|
<result property="surveyOutline" column="survey_outline" />
|
<result property="safetyRequire" column="safety_require" />
|
<result property="techRequire" column="tech_require" />
|
<result property="state" column="state" />
|
<result property="reason" column="reason" />
|
<result property="serialNumber" column="serial_number" />
|
<result property="isDeleted" column="is_deleted" />
|
<result property="archiveNo" column="archive_no" />
|
<result property="projectCategory" column="project_category" />
|
<result property="projectIntroduction" column="project_introduction" />
|
<result property="handInDate" column="hand_in_date" />
|
<result property="handInPost" column="hand_in_post" />
|
<result property="lng" column="lng" />
|
<result property="lat" column="lat" />
|
<result property="updateTime" column="update_time" />
|
<result property="createTime" column="create_time" />
|
<result property="createBy" column="create_by" />
|
<result property="holeCount" column="hole_count" />
|
</resultMap>
|
|
<sql id="selectProjectInfoVo">
|
select id, project_no, project_name, construction_unit, exproration_unit, service_unit, address_code, address, project_leader, project_enginer, start_time, planned_time, end_time, project_picture, survey_outline, safety_require, tech_require, state, reason, serial_number, is_deleted, archive_no, project_category, project_introduction, hand_in_date, hand_in_post, lng, lat, update_time, create_time, create_by,hole_count from js_project_info
|
</sql>
|
|
<select id="selectProjectInfoList" parameterType="ProjectInfo" resultMap="ProjectInfoResult">
|
<include refid="selectProjectInfoVo"/>
|
<where>
|
<if test="projectNo != null and projectNo != ''"> and project_no = #{projectNo}</if>
|
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
|
<if test="constructionUnit != null and constructionUnit != ''"> and construction_unit like concat('%', #{constructionUnit}, '%')</if>
|
<if test="exprorationUnit != null and exprorationUnit != ''"> and exproration_unit = #{exprorationUnit}</if>
|
<if test="serviceUnit != null and serviceUnit != ''"> and service_unit = #{serviceUnit}</if>
|
<if test="addressCode != null and addressCode != ''"> and address_code = #{addressCode}</if>
|
<if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
|
<if test="projectLeader != null and projectLeader != ''"> and project_leader = #{projectLeader}</if>
|
<if test="projectEnginer != null and projectEnginer != ''"> and project_enginer = #{projectEnginer}</if>
|
<if test="startTime != null "> and start_time >= #{startTime}</if>
|
<if test="plannedTime != null "> and planned_time = #{plannedTime}</if>
|
<if test="endTime != null "> and end_time <= #{endTime}</if>
|
<if test="projectPicture != null and projectPicture != ''"> and project_picture = #{projectPicture}</if>
|
<if test="surveyOutline != null and surveyOutline != ''"> and survey_outline = #{surveyOutline}</if>
|
<if test="safetyRequire != null and safetyRequire != ''"> and safety_require = #{safetyRequire}</if>
|
<if test="techRequire != null and techRequire != ''"> and tech_require = #{techRequire}</if>
|
<if test="state != null and state != ''"> and state = #{state}</if>
|
<if test="reason != null and reason != ''"> and reason = #{reason}</if>
|
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
|
<if test="isDeleted != null and isDeleted != ''"> and is_deleted = #{isDeleted}</if>
|
<if test="archiveNo != null and archiveNo != ''"> and archive_no = #{archiveNo}</if>
|
<if test="projectCategory != null and projectCategory != ''"> and project_category = #{projectCategory}</if>
|
<if test="projectIntroduction != null and projectIntroduction != ''"> and project_introduction = #{projectIntroduction}</if>
|
<if test="handInDate != null "> and hand_in_date = #{handInDate}</if>
|
<if test="handInPost != null and handInPost != ''"> and hand_in_post = #{handInPost}</if>
|
<if test="lng != null "> and lng = #{lng}</if>
|
<if test="lat != null "> and lat = #{lat}</if>
|
</where>
|
</select>
|
|
<select id="selectProjectInfoById" parameterType="String" resultMap="ProjectInfoResult">
|
<include refid="selectProjectInfoVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectProjectInfoListByName" parameterType="String" resultMap="ProjectInfoResult">
|
<include refid="selectProjectInfoVo"/>
|
where project_name = #{projectName}
|
</select>
|
|
<select id="selectByPolygon" parameterType="String" resultMap="ProjectInfoResult">
|
<include refid="selectProjectInfoVo"/>
|
where ST_CONTAINS(GeomFromText(#{polygon}), location);
|
</select>
|
|
<select id="selectByPolygonContains" parameterType="String" resultMap="ProjectInfoResult">
|
<include refid="selectProjectInfoVo"/>
|
where MBRContains(#{polygon}, GeomFromText(location));
|
</select>
|
|
<select id="selectBynCircle" resultMap="ProjectInfoResult">
|
<include refid="selectProjectInfoVo"/>
|
WHERE fun_distance(#{latitude},#{longitude} ,lat,lng) < #{radius}
|
</select>
|
|
<select id="selectEmptyLnglat" resultMap="ProjectInfoResult">
|
<include refid="selectProjectInfoVo"/>
|
where lng is null
|
</select>
|
|
|
<insert id="insertProjectInfo" parameterType="ProjectInfo">
|
insert into js_project_info
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null and id != ''">id,</if>
|
<if test="projectNo != null and projectNo != ''">project_no,</if>
|
<if test="projectName != null and projectName != ''">project_name,</if>
|
<if test="constructionUnit != null and constructionUnit != ''">construction_unit,</if>
|
<if test="exprorationUnit != null and exprorationUnit != ''">exproration_unit,</if>
|
<if test="serviceUnit != null and serviceUnit != ''">service_unit,</if>
|
<if test="addressCode != null and addressCode != ''">address_code,</if>
|
<if test="address != null and address != ''">address,</if>
|
<if test="projectLeader != null and projectLeader != ''">project_leader,</if>
|
<if test="projectEnginer != null and projectEnginer != ''">project_enginer,</if>
|
<if test="startTime != null ">start_time,</if>
|
<if test="plannedTime != null ">planned_time,</if>
|
<if test="endTime != null ">end_time,</if>
|
<if test="projectPicture != null and projectPicture != ''">project_picture,</if>
|
<if test="surveyOutline != null and surveyOutline != ''">survey_outline,</if>
|
<if test="safetyRequire != null and safetyRequire != ''">safety_require,</if>
|
<if test="techRequire != null and techRequire != ''">tech_require,</if>
|
<if test="state != null and state != ''">state,</if>
|
<if test="reason != null and reason != ''">reason,</if>
|
<if test="serialNumber != null and serialNumber != ''">serial_number,</if>
|
<if test="isDeleted != null and isDeleted != ''">is_deleted,</if>
|
<if test="archiveNo != null and archiveNo != ''">archive_no,</if>
|
<if test="projectCategory != null and projectCategory != ''">project_category,</if>
|
<if test="projectIntroduction != null and projectIntroduction != ''">project_introduction,</if>
|
<if test="handInDate != null ">hand_in_date,</if>
|
<if test="handInPost != null and handInPost != ''">hand_in_post,</if>
|
<if test="lng != null ">lng,</if>
|
<if test="lat != null ">lat,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null and id != ''">#{id},</if>
|
<if test="projectNo != null and projectNo != ''">#{projectNo},</if>
|
<if test="projectName != null and projectName != ''">#{projectName},</if>
|
<if test="constructionUnit != null and constructionUnit != ''">#{constructionUnit},</if>
|
<if test="exprorationUnit != null and exprorationUnit != ''">#{exprorationUnit},</if>
|
<if test="serviceUnit != null and serviceUnit != ''">#{serviceUnit},</if>
|
<if test="addressCode != null and addressCode != ''">#{addressCode},</if>
|
<if test="address != null and address != ''">#{address},</if>
|
<if test="projectLeader != null and projectLeader != ''">#{projectLeader},</if>
|
<if test="projectEnginer != null and projectEnginer != ''">#{projectEnginer},</if>
|
<if test="startTime != null ">#{startTime},</if>
|
<if test="plannedTime != null ">#{plannedTime},</if>
|
<if test="endTime != null ">#{endTime},</if>
|
<if test="projectPicture != null and projectPicture != ''">#{projectPicture},</if>
|
<if test="surveyOutline != null and surveyOutline != ''">#{surveyOutline},</if>
|
<if test="safetyRequire != null and safetyRequire != ''">#{safetyRequire},</if>
|
<if test="techRequire != null and techRequire != ''">#{techRequire},</if>
|
<if test="state != null and state != ''">#{state},</if>
|
<if test="reason != null and reason != ''">#{reason},</if>
|
<if test="serialNumber != null and serialNumber != ''">#{serialNumber},</if>
|
<if test="isDeleted != null and isDeleted != ''">#{isDeleted},</if>
|
<if test="archiveNo != null and archiveNo != ''">#{archiveNo},</if>
|
<if test="projectCategory != null and projectCategory != ''">#{projectCategory},</if>
|
<if test="projectIntroduction != null and projectIntroduction != ''">#{projectIntroduction},</if>
|
<if test="handInDate != null ">#{handInDate},</if>
|
<if test="handInPost != null and handInPost != ''">#{handInPost},</if>
|
<if test="lng != null ">#{lng},</if>
|
<if test="lat != null ">#{lat},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
</trim>
|
</insert>
|
|
<update id="updateProjectInfo" parameterType="ProjectInfo">
|
update js_project_info
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="projectNo != null and projectNo != ''">project_no = #{projectNo},</if>
|
<if test="projectName != null and projectName != ''">project_name = #{projectName},</if>
|
<if test="constructionUnit != null and constructionUnit != ''">construction_unit = #{constructionUnit},</if>
|
<if test="exprorationUnit != null and exprorationUnit != ''">exproration_unit = #{exprorationUnit},</if>
|
<if test="serviceUnit != null and serviceUnit != ''">service_unit = #{serviceUnit},</if>
|
<if test="addressCode != null and addressCode != ''">address_code = #{addressCode},</if>
|
<if test="address != null and address != ''">address = #{address},</if>
|
<if test="projectLeader != null and projectLeader != ''">project_leader = #{projectLeader},</if>
|
<if test="projectEnginer != null and projectEnginer != ''">project_enginer = #{projectEnginer},</if>
|
<if test="startTime != null ">start_time = #{startTime},</if>
|
<if test="plannedTime != null ">planned_time = #{plannedTime},</if>
|
<if test="endTime != null ">end_time = #{endTime},</if>
|
<if test="projectPicture != null and projectPicture != ''">project_picture = #{projectPicture},</if>
|
<if test="surveyOutline != null and surveyOutline != ''">survey_outline = #{surveyOutline},</if>
|
<if test="safetyRequire != null and safetyRequire != ''">safety_require = #{safetyRequire},</if>
|
<if test="techRequire != null and techRequire != ''">tech_require = #{techRequire},</if>
|
<if test="state != null and state != ''">state = #{state},</if>
|
<if test="reason != null and reason != ''">reason = #{reason},</if>
|
<if test="serialNumber != null and serialNumber != ''">serial_number = #{serialNumber},</if>
|
<if test="isDeleted != null and isDeleted != ''">is_deleted = #{isDeleted},</if>
|
<if test="archiveNo != null and archiveNo != ''">archive_no = #{archiveNo},</if>
|
<if test="projectCategory != null and projectCategory != ''">project_category = #{projectCategory},</if>
|
<if test="projectIntroduction != null and projectIntroduction != ''">project_introduction = #{projectIntroduction},</if>
|
<if test="handInDate != null ">hand_in_date = #{handInDate},</if>
|
<if test="handInPost != null and handInPost != ''">hand_in_post = #{handInPost},</if>
|
<if test="lng != null ">lng = #{lng},</if>
|
<if test="lat != null ">lat = #{lat},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteProjectInfoById" parameterType="String">
|
delete from js_project_info where id = #{id}
|
</delete>
|
|
<delete id="deleteProjectInfoByIds" parameterType="String">
|
delete from js_project_info where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
|
|
</mapper>
|