DropPointInfoMapper.xml 7.55 KB
<?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.trash.dropPointInfo.mapper.DropPointInfoMapper">

	<resultMap type="DropPointInfo" id="DropPointInfoResult">
		<result property="id" column="id" />
		<result property="dropPointName" column="drop_point_name" />
		<result property="district" column="district" />
		<result property="street" column="street" />
		<result property="community" column="community" />
		<result property="address" column="address" />
		<result property="type" column="type" />
		<result property="area" column="area" />
		<result property="capacity" column="capacity" />
		<result property="managementUnit" column="management_unit" />
		<result property="custodian" column="custodian" />
		<result property="custodianPhone" column="custodian_phone" />
		<result property="dropTime" column="drop_time" />
		<result property="dropPointNo" column="drop_point_no" />
		<result property="operatingUnit" column="operating_unit" />
		<result property="transportUnit" column="transport_unit" />
		<result property="coordinatePoint" column="coordinate_point" />
		<result property="createTime" column="create_time" />
		<result property="createBy" column="create_by" />
		<result property="updateTime" column="update_time" />
		<result property="updateBy" column="update_by" />
		<result property="status" column="status" />
		<result property="plot" column="plot" />
	</resultMap>

	<sql id="selectDropPointInfoVo">
		select id, drop_point_name, district, street, community, address, type,
		area, capacity, management_unit, custodian, custodian_phone,
		drop_time, drop_point_no, operating_unit,status,
		transport_unit,coordinate_point, create_time, create_by, update_time,
		update_by,plot from drop_point_info
	</sql>

	<select id="selectDropPointInfoList" parameterType="DropPointInfo"
		resultMap="DropPointInfoResult">
		<include refid="selectDropPointInfoVo" />
		<where>
			<if test="dropPointName != null  and dropPointName != ''"> and drop_point_name like concat('%', #{dropPointName},
				'%')</if>
			<if test="address != null  and address != ''"> and address like concat('%', #{address}, '%')</if>
			<if test="type != null  and type != ''"> and type = #{type}</if>
			<if test="dropPointNo != null  and dropPointNo != ''"> and drop_point_no like concat(#{dropPointNo}, '%')</if>
			 <if test="district != null  and district != ''"> and district = #{district}</if>
			  <if test="street != null  and street != ''"> and street = #{street}</if>
			   <if test="community != null  and community != ''"> and community = #{community}</if>
			<if test="sList != null  and sList.size() > 0 ">
				and street in
				<foreach item="id" collection="sList" open="(" separator=","
					close=")">
					#{id}
				</foreach>
			</if>
		</where>
	</select>

	<select id="selectDropPointInfoListByPhone" parameterType="String"
			resultMap="DropPointInfoResult">
		<include refid="selectDropPointInfoVo" />
		where custodian_phone = #{custodianPhone}
	</select>

	<select id="selectPhoneByDropPointNo" parameterType="String" resultType="java.lang.String">
		select custodian_phone from drop_point_info where drop_point_no = #{dropPointNo}
	</select>

	<select id="selectDropPointInfoById" parameterType="Long"
		resultMap="DropPointInfoResult">
		<include refid="selectDropPointInfoVo" />
		where id = #{id}
	</select>

	<insert id="insertDropPointInfo" parameterType="DropPointInfo"
		useGeneratedKeys="true" keyProperty="id">
		insert into drop_point_info
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="dropPointName != null">drop_point_name,</if>
			<if test="district != null">district,</if>
			<if test="street != null">street,</if>
			<if test="community != null">community,</if>
			<if test="address != null">address,</if>
			<if test="type != null">type,</if>
			<if test="area != null">area,</if>
			<if test="capacity != null">capacity,</if>
			<if test="managementUnit != null">management_unit,</if>
			<if test="custodian != null">custodian,</if>
			<if test="custodianPhone != null">custodian_phone,</if>
			<if test="dropTime != null">drop_time,</if>
			<if test="dropPointNo != null">drop_point_no,</if>
			<if test="operatingUnit != null">operating_unit,</if>
			<if test="transportUnit != null">transport_unit,</if>
			<if test="coordinatePoint != null">coordinate_point,</if>
			<if test="createTime != null">create_time,</if>
			<if test="createBy != null">create_by,</if>
			<if test="updateTime != null">update_time,</if>
			<if test="updateBy != null">update_by,</if>
		    <if test="plot != null">plot,</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="dropPointName != null">#{dropPointName},</if>
			<if test="district != null">#{district},</if>
			<if test="street != null">#{street},</if>
			<if test="community != null">#{community},</if>
			<if test="address != null">#{address},</if>
			<if test="type != null">#{type},</if>
			<if test="area != null">#{area},</if>
			<if test="capacity != null">#{capacity},</if>
			<if test="managementUnit != null">#{managementUnit},</if>
			<if test="custodian != null">#{custodian},</if>
			<if test="custodianPhone != null">#{custodianPhone},</if>
			<if test="dropTime != null">#{dropTime},</if>
			<if test="dropPointNo != null">#{dropPointNo},</if>
			<if test="operatingUnit != null">#{operatingUnit},</if>
			<if test="transportUnit != null">#{transportUnit},</if>
			<if test="coordinatePoint != null">#{coordinatePoint},</if>
			<if test="createTime != null">#{createTime},</if>
			<if test="createBy != null">#{createBy},</if>
			<if test="updateTime != null">#{updateTime},</if>
			<if test="updateBy != null">#{updateBy},</if>
			<if test="plot != null">#{plot},</if>
		</trim>
	</insert>

	<update id="updateDropPointInfo" parameterType="DropPointInfo">
		update drop_point_info
		<trim prefix="SET" suffixOverrides=",">
			<if test="dropPointName != null">drop_point_name = #{dropPointName},</if>
			<if test="district != null">district = #{district},</if>
			<if test="street != null">street = #{street},</if>
			<if test="community != null">community = #{community},</if>
			<if test="address != null">address = #{address},</if>
			<if test="type != null">type = #{type},</if>
			<if test="area != null">area = #{area},</if>
			<if test="capacity != null">capacity = #{capacity},</if>
			<if test="managementUnit != null">management_unit = #{managementUnit},</if>
			<if test="custodian != null">custodian = #{custodian},</if>
			<if test="custodianPhone != null">custodian_phone = #{custodianPhone},</if>
			<if test="dropTime != null">drop_time = #{dropTime},</if>
			<if test="dropPointNo != null">drop_point_no = #{dropPointNo},</if>
			<if test="operatingUnit != null">operating_unit = #{operatingUnit},</if>
			<if test="transportUnit != null">transport_unit = #{transportUnit},</if>
			<if test="coordinatePoint != null">coordinate_point = #{coordinatePoint},</if>
			<if test="createTime != null">create_time = #{createTime},</if>
			<if test="createBy != null">create_by = #{createBy},</if>
			<if test="updateTime != null">update_time = #{updateTime},</if>
			<if test="updateBy != null">update_by = #{updateBy},</if>
			<if test="plot != null">plot = #{plot},</if>
		</trim>
		where id = #{id}
	</update>

	<delete id="deleteDropPointInfoById" parameterType="Long">
		delete from drop_point_info where id = #{id}
	</delete>

	<delete id="deleteDropPointInfoByIds" parameterType="String">
		delete from drop_point_info where id in
		<foreach item="id" collection="array" open="(" separator=","
			close=")">
			#{id}
		</foreach>
	</delete>

</mapper>