<?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.ProjectMapper">
|
|
<resultMap type="Project" id="ProjectResult">
|
<result property="ids" column="ids" />
|
<result property="address" column="address" />
|
<result property="city" column="city" />
|
<result property="code" column="code" />
|
<result property="companyId" column="company_id" />
|
<result property="companyName" column="company_name" />
|
<result property="startTime" column="start_time" />
|
<result property="endTime" column="end_time" />
|
<result property="district" column="district" />
|
<result property="fullName" column="full_name" />
|
<result property="laborUnit" column="labor_unit" />
|
<result property="leader" column="leader" />
|
<result property="leaderName" column="leader_name" />
|
<result property="owner" column="owner" />
|
<result property="province" column="province" />
|
<result property="serialNumber" column="serial_number" />
|
<result property="describe" column="describe" />
|
<result property="status" column="status" />
|
<result property="isDeleted" column="is_deleted" />
|
<result property="statusChangeUser" column="status_change_user" />
|
<result property="statusChangeReason" column="status_change_reason" />
|
<result property="dataSource" column="data_source" />
|
<result property="lng" column="lng" />
|
<result property="lat" column="lat" />
|
<result property="rate" column="rate" />
|
<result property="createTime" column="create_time" />
|
</resultMap>
|
|
<sql id="selectProjectVo">
|
select ids, address, city, code, company_id,start_time,end_time, district, full_name, labor_unit, leader, owner, province, serial_number, 'describe', status, is_deleted, status_change_user, status_change_reason, data_source,lng,lat,rate,create_time from js_project
|
</sql>
|
|
<select id="selectProjectList" parameterType="Project" resultMap="ProjectResult">
|
<include refid="selectProjectVo"/>
|
<where>
|
<if test="address != null and address != ''"> and address = #{address}</if>
|
<if test="city != null "> and city = #{city}</if>
|
<if test="code != null and code != ''"> and code = #{code}</if>
|
<if test="district != null and district != ''"> and district = #{district}</if>
|
<if test="fullName != null and fullName != ''"> and full_name like concat('%', #{fullName}, '%')</if>
|
<if test="laborUnit != null and laborUnit != ''"> and labor_unit = #{laborUnit}</if>
|
<if test="leader != null and leader != ''"> and leader = #{leader}</if>
|
<if test="owner != null and owner != ''"> and owner = #{owner}</if>
|
<if test="province != null and province != ''"> and province = #{province}</if>
|
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="isDeleted != null and isDeleted != ''"> and is_deleted = #{isDeleted}</if>
|
</where>
|
</select>
|
|
<select id="selectProjectById" parameterType="String" resultMap="ProjectResult">
|
<include refid="selectProjectVo"/>
|
WHERE ids = #{ids}
|
</select>
|
|
<insert id="insertProject" parameterType="Project">
|
insert into js_project
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="ids != null and ids != ''">ids,</if>
|
<if test="address != null and address != ''">address,</if>
|
<if test="city != null ">city,</if>
|
<if test="code != null and code != ''">code,</if>
|
<if test="companyId != null ">company_id,</if>
|
<if test="startTime != null ">start_time,</if>
|
<if test="endTime != null ">end_time,</if>
|
<if test="district != null and district != ''">district,</if>
|
<if test="fullName != null and fullName != ''">full_name,</if>
|
<if test="laborUnit != null and laborUnit != ''">labor_unit,</if>
|
<if test="leader != null and leader != ''">leader,</if>
|
<if test="owner != null and owner != ''">owner,</if>
|
<if test="province != null and province != ''">province,</if>
|
<if test="serialNumber != null and serialNumber != ''">serial_number,</if>
|
<if test="describe != null and describe != ''">`describe`,</if>
|
<if test="status != null and status != ''">status,</if>
|
<if test="isDeleted != null and isDeleted != ''">is_deleted,</if>
|
<if test="statusChangeUser != null and statusChangeUser != ''">status_change_user,</if>
|
<if test="statusChangeReason != null and statusChangeReason != ''">status_change_reason,</if>
|
<if test="dataSource != null and dataSource != ''">data_source,</if>
|
<if test="lng != null">lng,</if>
|
<if test="lat != null">lat,</if>
|
<if test="rate != null and rate != ''">rate,</if>
|
<if test="createTime != null ">create_time,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="ids != null and ids != ''">#{ids},</if>
|
<if test="address != null and address != ''">#{address},</if>
|
<if test="city != null ">#{city},</if>
|
<if test="code != null and code != ''">#{code},</if>
|
<if test="companyId != null ">#{companyId},</if>
|
<if test="startTime != null ">#{startTime},</if>
|
<if test="endTime != null ">#{endTime},</if>
|
|
<if test="district != null and district != ''">#{district},</if>
|
<if test="fullName != null and fullName != ''">#{fullName},</if>
|
<if test="laborUnit != null and laborUnit != ''">#{laborUnit},</if>
|
<if test="leader != null and leader != ''">#{leader},</if>
|
<if test="owner != null and owner != ''">#{owner},</if>
|
<if test="province != null and province != ''">#{province},</if>
|
<if test="serialNumber != null and serialNumber != ''">#{serialNumber},</if>
|
<if test="describe != null and describe != ''">#{describe},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
<if test="isDeleted != null and isDeleted != ''">#{isDeleted},</if>
|
<if test="statusChangeUser != null and statusChangeUser != ''">#{statusChangeUser},</if>
|
<if test="statusChangeReason != null and isDeleted != ''">#{statusChangeReason},</if>
|
<if test="dataSource != null and dataSource != ''">#{dataSource},</if>
|
<if test="lng != null">#{lng},</if>
|
<if test="lat != null">#{lat},</if>
|
<if test="rate != null and rate != ''">#{rate},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
</trim>
|
</insert>
|
|
<update id="updateProject" parameterType="Project">
|
update js_project
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="address != null and address != ''">address = #{address},</if>
|
<if test="city != null ">city = #{city},</if>
|
<if test="code != null and code != ''">code = #{code},</if>
|
<if test="companyId != null ">company_id = #{companyId},</if>
|
<if test="startTime != null ">start_time = #{startTime},</if>
|
<if test="endTime != null ">end_time = #{endTime},</if>
|
<if test="district != null and district != ''">district = #{district},</if>
|
<if test="fullName != null and fullName != ''">full_name = #{fullName},</if>
|
<if test="laborUnit != null and laborUnit != ''">labor_unit = #{laborUnit},</if>
|
<if test="leader != null and leader != ''">leader = #{leader},</if>
|
<if test="owner != null and owner != ''">owner = #{owner},</if>
|
<if test="province != null and province != ''">province = #{province},</if>
|
<if test="serialNumber != null and serialNumber != ''">serial_number = #{serialNumber},</if>
|
<if test="describe != null and describe != ''">`describe` = #{describe},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="isDeleted != null and isDeleted != ''">is_deleted = #{isDeleted},</if>
|
<if test="statusChangeUser != null and statusChangeUser != ''">status_change_user = #{statusChangeUser},</if>
|
<if test="statusChangeReason != null and statusChangeReason != ''">status_change_reason = #{statusChangeReason},</if>
|
<if test="dataSource != null and dataSource != ''">data_source = #{dataSource},</if>
|
<if test="lng != null">lng = #{lng},</if>
|
<if test="lat != null">lat = #{lat},</if>
|
<if test="rate != null and rate != ''">rate = #{rate},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
</trim>
|
where ids = #{ids}
|
</update>
|
|
<delete id="deleteProjectById" parameterType="String">
|
delete from js_project where ids = #{ids}
|
</delete>
|
|
<delete id="deleteProjectByIds" parameterType="String">
|
delete from js_project where ids in
|
<foreach item="ids" collection="array" open="(" separator="," close=")">
|
#{ids}
|
</foreach>
|
</delete>
|
|
</mapper>
|