Authored by ping

增加优惠券表

package com.yoho.coupon.dal;
import com.yoho.coupon.dal.model.OrderShareCoupon;
public interface IOrderShareCouponDAO {
int deleteByPrimaryKey(Integer id);
int insert(OrderShareCoupon record);
int insertSelective(OrderShareCoupon record);
OrderShareCoupon selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(OrderShareCoupon record);
int updateByPrimaryKey(OrderShareCoupon record);
}
\ No newline at end of file
... ...
package com.yoho.coupon.dal.model;
import com.yoho.queue.dal.model.BaseModel;
public class OrderShareCoupon extends BaseModel {
/**
*
*/
private static final long serialVersionUID = -190907556765459407L;
private Integer id;
private String couponId;
private String couponName;
private String useDate;
private Integer couponType;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCouponId() {
return couponId;
}
public void setCouponId(String couponId) {
this.couponId = couponId == null ? null : couponId.trim();
}
public String getCouponName() {
return couponName;
}
public void setCouponName(String couponName) {
this.couponName = couponName == null ? null : couponName.trim();
}
public String getUseDate() {
return useDate;
}
public void setUseDate(String useDate) {
this.useDate = useDate == null ? null : useDate.trim();
}
public Integer getCouponType() {
return couponType;
}
public void setCouponType(Integer couponType) {
this.couponType = couponType;
}
}
\ No newline at end of file
... ...
<?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.yoho.coupon.dal.IOrderShareCouponDAO">
<resultMap id="BaseResultMap" type="com.yoho.coupon.dal.model.OrderShareCoupon">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="coupon_id" property="couponId" jdbcType="VARCHAR" />
<result column="coupon_name" property="couponName" jdbcType="VARCHAR" />
<result column="use_date" property="useDate" jdbcType="VARCHAR" />
<result column="coupon_type" property="couponType" jdbcType="TINYINT" />
</resultMap>
<sql id="Base_Column_List">
id, coupon_id, coupon_name, use_date, coupon_type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.lang.Integer">
select
<include refid="Base_Column_List" />
from order_share_coupon
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from order_share_coupon
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.coupon.dal.model.OrderShareCoupon">
insert into order_share_coupon (id, coupon_id, coupon_name,
use_date, coupon_type)
values (#{id,jdbcType=INTEGER}, #{couponId,jdbcType=VARCHAR},
#{couponName,jdbcType=VARCHAR},
#{useDate,jdbcType=VARCHAR}, #{couponType,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.yoho.coupon.dal.model.OrderShareCoupon">
insert into order_share_coupon
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="couponId != null">
coupon_id,
</if>
<if test="couponName != null">
coupon_name,
</if>
<if test="useDate != null">
use_date,
</if>
<if test="couponType != null">
coupon_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="couponId != null">
#{couponId,jdbcType=VARCHAR},
</if>
<if test="couponName != null">
#{couponName,jdbcType=VARCHAR},
</if>
<if test="useDate != null">
#{useDate,jdbcType=VARCHAR},
</if>
<if test="couponType != null">
#{couponType,jdbcType=TINYINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.coupon.dal.model.OrderShareCoupon">
update order_share_coupon
<set>
<if test="couponId != null">
coupon_id = #{couponId,jdbcType=VARCHAR},
</if>
<if test="couponName != null">
coupon_name = #{couponName,jdbcType=VARCHAR},
</if>
<if test="useDate != null">
use_date = #{useDate,jdbcType=VARCHAR},
</if>
<if test="couponType != null">
coupon_type = #{couponType,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.coupon.dal.model.OrderShareCoupon">
update order_share_coupon
set coupon_id = #{couponId,jdbcType=VARCHAR},
coupon_name = #{couponName,jdbcType=VARCHAR},
use_date = #{useDate,jdbcType=VARCHAR},
coupon_type = #{couponType,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
... ...