嗨森逛服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hai-server/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapperExt.java

87 lines
4.3 KiB

4 years ago
package com.hai.dao;
4 years ago
import com.hai.entity.HighCouponCode;
4 years ago
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
4 years ago
import java.util.List;
4 years ago
/**
* mapper扩展类
*/
public interface HighCouponCodeMapperExt {
4 years ago
@Insert({
"<script>",
"insert into high_coupon_code (" +
"coupon_id, " +
"merchant_id, ",
"is_assign_agent," +
"agent_id, ",
"store_id, " +
"child_order_id," +
"code_key, " +
"sales_code," +
"sales_end_time," +
"use_end_time, ",
"create_time," +
"receive_time, ",
"consume_time, " +
"`status`, ",
"operator_id, " +
"operator_name, ",
4 years ago
"ext_1, ext_2, ext_3)",
"values ",
"<foreach collection='list' item='item' index='index' separator=','>",
"(#{item.couponId,jdbcType=BIGINT}, " +
"#{item.merchantId,jdbcType=BIGINT}," +
"#{item.isAssignAgent,jdbcType=BIT}," +
"#{item.agentId,jdbcType=BIGINT}," +
"#{item.storeId,jdbcType=BIGINT}," +
4 years ago
"#{item.childOrderId,jdbcType=BIGINT}, " +
"#{item.codeKey,jdbcType=VARCHAR}, " +
4 years ago
"#{item.salesCode,jdbcType=VARCHAR}, ",
"#{item.salesEndTime,jdbcType=TIMESTAMP}," +
"#{item.useEndTime,jdbcType=TIMESTAMP}, ",
"#{item.createTime,jdbcType=TIMESTAMP}, " +
"#{item.receiveTime,jdbcType=TIMESTAMP}, ",
"#{item.consumeTime,jdbcType=TIMESTAMP}," +
"#{item.status,jdbcType=INTEGER}, ",
"#{item.operatorId,jdbcType=BIGINT}, " +
"#{item.operatorName,jdbcType=VARCHAR}, ",
"#{item.ext1,jdbcType=VARCHAR}," +
"#{item.ext2,jdbcType=VARCHAR}, " +
"#{item.ext3,jdbcType=VARCHAR})",
"</foreach>",
"</script>"
})
void insertList(@Param(value = "list") List<HighCouponCode> list);
4 years ago
@Select("select * from high_coupon_code where child_order_id = (SELECT b.id child_order_id FROM high_order a,high_child_order b where a.mem_discount_id = #{discountUserRelId} and a.id = b.order_id and b.goods_type = 1 and b.child_orde_status in (2,3,4))")
@Results({
@Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true),
@Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT),
@Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT),
@Result(column="is_assign_agent", property="isAssignAgent", jdbcType=JdbcType.BIT),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
@Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="code_key", property="codeKey", jdbcType=JdbcType.VARCHAR),
@Result(column="sales_code", property="salesCode", jdbcType=JdbcType.VARCHAR),
@Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="use_end_time", property="useEndTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="receive_time", property="receiveTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="consume_time", property="consumeTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
HighCouponCode selectCouponCodeByUserDiscount(@Param("discountUserRelId") Long discountUserRelId);
4 years ago
}