<?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.yeejoin.amos.maintenance.business.dao.mapper.RoutePointItemMapper">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.yeejoin.amos.maintenance.dao.entity.RoutePointItem" id="routePointItemMap">
        <result property="routePointId" column="route_point_id"/>
        <result property="orderNo" column="order_no"/>
        <result property="pointClassifyId" column="point_classify_id"/>
        <result property="pointInputItemId" column="point_input_item_id"/>
        <result property="creatorId" column="creator_id"/>
        <result property="createDate" column="create_date"/>
        <result property="pointClassifyId" column="point_classify_id"/>
        <result property="basisJson" column="basis_json"/>
    </resultMap>

    <update id="updateRoutePointItem" parameterType="com.yeejoin.amos.maintenance.dao.entity.RoutePointItem">
        UPDATE p_route_point_item
        <trim prefix="set" suffixOverrides=",">
            <if test="routePointId != null">route_point_id=#{routePointId},</if>
            <if test="orderNo != null ">order_no=#{orderNo},</if>
            <if test="pointInputItemId != null">point_input_item_id=#{pointInputItemId},</if>
            <if test="creatorId != null">creator_id=#{creatorId},</if>
            <if test="createDate != null">create_date=#{createDate},</if>
            <if test="pointClassifyId != null">point_classify_id=#{pointClassifyId},</if>
            <if test="basisJson != null ">basis_json=#{basisJson},</if>
        </trim>
        WHERE id=#{id}
    </update>

    <delete id="delRoutePointItemByRouteId">
        DELETE
        FROM
          p_route_point_item
        WHERE
          route_point_id IN (
            SELECT
              id
            FROM
              p_route_point prp
            WHERE
              route_id = #{routeId}
          )
    </delete>
</mapper>