12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?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.fuzamei.mapperInterface.OperationHistoryMapper">
-
- <!-- 插入订单操作记录表中 -->
- <insert id="addToHistory">
- insert into
- operation_history(order_id,
- operation_type_id,
- operator_id,
- operation_time)
- values(#{orderId},
- #{operationTypeId},
- #{operatorId},
- #{operationTime})
- </insert>
-
- <select id="queryOperationHistory" parameterType="Params" resultType="OperationHistory">
- select
- oh.order_id,
- ot.operation_type_name,
- u.person_name as operatorName,
- oh.operation_time
- from
- operation_history oh
- left join
- operation_type ot
- on
- oh.operation_type_id=ot.operation_type_id
- left join
- users u
- on
- oh.operator_id=u.user_id
- <where>
- <if test="startTime!=null and endTime!=null">
- oh.operation_time between #{startTime} and #{endTime}
- </if>
- </where>
- order by oh.operation_time desc
- limit #{startPage},#{rowNum}
- </select>
-
- <select id="findQueryCount" parameterType="Params" resultType="int">
- select
- count(*)
- from
- operation_history
- <where>
- <if test="startTime!=null and endTime!=null">
- operation_time between #{startTime} and #{endTime}
- </if>
- </where>
- </select>
-
- </mapper>
|