|
|
@@ -10,11 +10,71 @@
|
|
|
<result column="order_note" property="orderNote" jdbcType="VARCHAR"/>
|
|
|
<result column="order_expected_time" property="orderExpectedTime" jdbcType="TIMESTAMP"/>
|
|
|
<result column="order_complete_time" property="orderCompleteTime" jdbcType="TIMESTAMP"/>
|
|
|
+ <result column="order_commit_time" property="orderCommitTime" jdbcType="TIMESTAMP"/>
|
|
|
<result column="order_advice" property="orderAdvice" jdbcType="VARCHAR"/>
|
|
|
<result column="order_status" property="orderStatus" jdbcType="VARCHAR"/>
|
|
|
<result column="order_price" property="orderPrice" jdbcType="DECIMAL"/>
|
|
|
<result column="order_price_status" property="orderPriceStatus" jdbcType="VARCHAR"/>
|
|
|
<result column="work_id" property="workId" jdbcType="INTEGER"/>
|
|
|
<result column="student_id" property="studentId" jdbcType="VARCHAR"/>
|
|
|
+ <result column="order_back" property="orderBack" jdbcType="VARCHAR"/>
|
|
|
</resultMap>
|
|
|
+
|
|
|
+ <resultMap id="OrderFaultStudentMap" type="com.chuanghai.repair.entity.RepairsOrder" >
|
|
|
+ <id column="order_id" property="orderId" jdbcType="VARCHAR"/>
|
|
|
+ <result column="order_images" property="orderImages" jdbcType="VARCHAR"/>
|
|
|
+ <result column="order_note" property="orderNote" jdbcType="VARCHAR"/>
|
|
|
+ <result column="order_expected_time" property="orderExpectedTime" jdbcType="TIMESTAMP"/>
|
|
|
+ <result column="order_complete_time" property="orderCompleteTime" jdbcType="TIMESTAMP"/>
|
|
|
+ <result column="order_commit_time" property="orderCommitTime" jdbcType="TIMESTAMP"/>
|
|
|
+
|
|
|
+ <result column="order_advice" property="orderAdvice" jdbcType="VARCHAR"/>
|
|
|
+ <result column="order_status" property="orderStatus" jdbcType="VARCHAR"/>
|
|
|
+ <result column="order_price" property="orderPrice" jdbcType="DECIMAL"/>
|
|
|
+ <result column="order_price_status" property="orderPriceStatus" jdbcType="VARCHAR"/>
|
|
|
+ <result column="order_back" property="orderBack" jdbcType="VARCHAR"/>
|
|
|
+<!-- 订单与学生之间是 N:1 关系-->
|
|
|
+ <association property="repairsStudent" javaType="com.chuanghai.repair.entity.RepairsStudent">
|
|
|
+ <id column="student_id" property="studentId"></id>
|
|
|
+ <result column="student_build_floor_room" property="studentBuildFloorRoom" jdbcType="VARCHAR"/>
|
|
|
+ </association >
|
|
|
+<!-- 订单与维修工之间是 N:1 关系-->
|
|
|
+ <association property="repairsWork" javaType="com.chuanghai.repair.entity.RepairsWork">
|
|
|
+ <id column="work_id" property="workId"></id>
|
|
|
+ </association >
|
|
|
+<!-- 订单与故障类型之间是 N:1 关系-->
|
|
|
+ <association property="repairsFault" javaType="com.chuanghai.repair.entity.RepairsFault">
|
|
|
+ <id column="fault_id" property="faultId"></id>
|
|
|
+ <result column="fault_name" property="faultName" jdbcType="VARCHAR"/>
|
|
|
+ </association >
|
|
|
+
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+<!-- 通过学生ID查询订单信息-->
|
|
|
+ <select id="queryByStudentIdOrder" parameterType="java.lang.String" resultMap="OrderFaultStudentMap">
|
|
|
+ select od.order_id, od.order_status,od.order_commit_time, fa.fault_name,st.student_build_floor_room, od.order_expected_time
|
|
|
+ from repairs_order od ,repairs_student st ,repairs_fault fa ,repairs_fault_order rfo
|
|
|
+ where od.student_id = st.student_id and od.order_id = rfo.order_id
|
|
|
+ and rfo.fault_id = fa.fault_id
|
|
|
+ and st.student_id = #{studentId}
|
|
|
+ and od.order_commit_time BETWEEN #{tody} and #{tomorrow}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 订单修后评价-->
|
|
|
+ <select id="updateOrderAdvice" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
|
+ update repairs_order
|
|
|
+ <set>
|
|
|
+ <if test="orderAdvice!='' and orderAdvice!= null">
|
|
|
+ order_advice = #{orderAdvice},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ <trim prefix="where" prefixOverrides="and" suffix="" suffixOverrides="">
|
|
|
+ <if test="orderId!='' and orderId!=null">
|
|
|
+ and order_id = #{orderId}
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
</mapper>
|