|
@@ -45,6 +45,55 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getTotalCount" parameterType="com.bosshand.virgo.api.workark.model.OrderInfo" resultType="Integer">
|
|
|
+ SELECT count(*) FROM workark_orderInfo
|
|
|
+ <where>
|
|
|
+ <if test="title != null">
|
|
|
+ and title = #{title}
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null">
|
|
|
+ and orderNo = #{orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="userId != 0">
|
|
|
+ and userId = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="productId != null">
|
|
|
+ and productId = #{productId}
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ and orderStatus = #{orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="paymentType != null">
|
|
|
+ and paymentType = #{paymentType}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getLimit" resultMap="result">
|
|
|
+ select * from workark_orderInfo
|
|
|
+ <where>
|
|
|
+ <if test="p.title != null">
|
|
|
+ and title = #{p.title}
|
|
|
+ </if>
|
|
|
+ <if test="p.orderNo != null">
|
|
|
+ and orderNo = #{p.orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="p.userId != 0">
|
|
|
+ and userId = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.productId != null">
|
|
|
+ and productId = #{p.productId}
|
|
|
+ </if>
|
|
|
+ <if test="p.orderStatus != null">
|
|
|
+ and orderStatus = #{p.orderStatus}
|
|
|
+ </if>
|
|
|
+ <if test="p.paymentType != null">
|
|
|
+ and paymentType = #{p.paymentType}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by createTime desc limit #{currIndex} , #{pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
INSERT INTO workark_orderInfo (createTime, title, orderNo, userId, productId, totalFee, codeUrl, orderStatus, paymentType, productCouponIds) VALUES
|
|
|
(now(), #{title}, #{orderNo}, #{userId}, #{productId}, #{totalFee}, #{codeUrl}, #{orderStatus}, #{paymentType}, #{productCouponIds})
|