HotelOrderProcedureMapper.xml 1.9 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.sibu.orderHelper.base.dao.IMWebRoomOrderProcedureDao">
	<!-- orderProcedure List -->
	<resultMap type="com.sibu.orderHelper.hotel.model.RoomOrderProcedureBean" id="orderProcedureList">
		<id column="procedure_id" property="procedureId" javaType="java.lang.Integer" jdbcType="BIGINT"/>
		<result column="sub_order_id" property="subOrderId" javaType="java.lang.String" jdbcType="VARCHAR"/>
		<result column="order_id" property="orderId" javaType="java.lang.String" jdbcType="VARCHAR"/>
		<result column="operator_msg" property="operatorMsg" javaType="java.lang.String" jdbcType="VARCHAR"/>
		<result column="operator_date" property="operatorDate" javaType="java.util.Date"  jdbcType="TIMESTAMP"/>
	</resultMap>
	<!-- 查询客栈订单列表 -->
	<select id="selectOrderProcedureBySubOrderId" parameterType="java.lang.String" resultMap="orderProcedureList">
		 SELECT 
		  procedure_id,
		  sub_order_id,
		  order_id,
		  operator_msg,
		  operator_date 
		FROM
	    room_order_procedure
	    where sub_order_id=#{subOrderId}
	 </select>
	 <!-- 保存订订单操作日志 -->
	<insert id="save" parameterType="com.sibu.orderHelper.hotel.model.RoomOrderProcedureBean">
		insert into  room_order_procedure  
		(  
		 sub_order_id , 
		 order_id , 
		 operator_msg
		)
		value(
			#{subOrderId},
			#{orderId},
			#{operatorMsg}
		);
 
	</insert>
	<insert id="saveSubOrdersProcedure" parameterType="java.util.List">
		<![CDATA[
		insert into room_order_procedure  
		(  
		 sub_order_id , 
		 order_id , 
		 operator_msg
		)
		values
		]]>
		<foreach collection="ordersProcedures" item="item" index="index" separator="," >
		(	#{item.subOrderId}, 
			#{item.orderId}, 
			#{item.operatorMsg}
		)
 		</foreach>
	</insert>
</mapper>