|
|
<?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.message.dal.IMiniappMsgFormDAO" >
|
|
|
<resultMap id="BaseResultMap" type="com.yoho.message.dal.model.MiniappMsgForm" >
|
|
|
<id column="id" property="id" jdbcType="INTEGER" />
|
|
|
<result column="form_id" property="formId" jdbcType="VARCHAR" />
|
|
|
<result column="available_times" property="availableTimes" jdbcType="INTEGER" />
|
|
|
<result column="create_time" property="createTime" jdbcType="INTEGER" />
|
|
|
<result column="open_id" property="openId" jdbcType="VARCHAR" />
|
|
|
<result column="order_code" property="orderCode" jdbcType="VARCHAR" />
|
|
|
<result column="miniapp_type" property="miniappType" jdbcType="INTEGER" />
|
|
|
<result column="uid" property="uid" jdbcType="INTEGER" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List" >
|
|
|
id, form_id, available_times, create_time, open_id, order_code, miniapp_type, uid
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from miniapp_msg_form
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectByOrderCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from miniapp_msg_form
|
|
|
where order_code = #{orderCode,jdbcType=VARCHAR}
|
|
|
order by create_time
|
|
|
limit 1
|
|
|
</select>
|
|
|
|
|
|
<select id="selectLastedAvailabByOrderCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from miniapp_msg_form
|
|
|
where order_code = #{orderCode,jdbcType=VARCHAR}
|
|
|
and available_times > 0
|
|
|
and create_time > unix_timestamp(now()) - 7*24*60*60
|
|
|
order by create_time
|
|
|
limit 1
|
|
|
</select>
|
|
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
|
delete from miniapp_msg_form
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.yoho.message.dal.model.MiniappMsgForm" >
|
|
|
insert into miniapp_msg_form (id, form_id, available_times,
|
|
|
create_time, open_id, order_code,
|
|
|
miniapp_type, uid)
|
|
|
values (#{id,jdbcType=INTEGER}, #{formId,jdbcType=VARCHAR}, #{availableTimes,jdbcType=INTEGER},
|
|
|
#{createTime,jdbcType=INTEGER}, #{openId,jdbcType=VARCHAR}, #{orderCode,jdbcType=VARCHAR},
|
|
|
#{miniappType,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.yoho.message.dal.model.MiniappMsgForm" >
|
|
|
insert into miniapp_msg_form
|
|
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
<if test="id != null" >
|
|
|
id,
|
|
|
</if>
|
|
|
<if test="formId != null" >
|
|
|
form_id,
|
|
|
</if>
|
|
|
<if test="availableTimes != null" >
|
|
|
available_times,
|
|
|
</if>
|
|
|
<if test="createTime != null" >
|
|
|
create_time,
|
|
|
</if>
|
|
|
<if test="openId != null" >
|
|
|
open_id,
|
|
|
</if>
|
|
|
<if test="orderCode != null" >
|
|
|
order_code,
|
|
|
</if>
|
|
|
<if test="miniappType != null" >
|
|
|
miniapp_type,
|
|
|
</if>
|
|
|
<if test="uid != null" >
|
|
|
uid,
|
|
|
</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
<if test="id != null" >
|
|
|
#{id,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="formId != null" >
|
|
|
#{formId,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="availableTimes != null" >
|
|
|
#{availableTimes,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="createTime != null" >
|
|
|
#{createTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="openId != null" >
|
|
|
#{openId,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="orderCode != null" >
|
|
|
#{orderCode,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="miniappType != null" >
|
|
|
#{miniappType,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="uid != null" >
|
|
|
#{uid,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.message.dal.model.MiniappMsgForm" >
|
|
|
update miniapp_msg_form
|
|
|
<set >
|
|
|
<if test="formId != null" >
|
|
|
form_id = #{formId,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="availableTimes != null" >
|
|
|
available_times = #{availableTimes,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="createTime != null" >
|
|
|
create_time = #{createTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="openId != null" >
|
|
|
open_id = #{openId,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="orderCode != null" >
|
|
|
order_code = #{orderCode,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="miniappType != null" >
|
|
|
miniapp_type = #{miniappType,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="uid != null" >
|
|
|
uid = #{uid,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.yoho.message.dal.model.MiniappMsgForm" >
|
|
|
update miniapp_msg_form
|
|
|
set form_id = #{formId,jdbcType=VARCHAR},
|
|
|
available_times = #{availableTimes,jdbcType=INTEGER},
|
|
|
create_time = #{createTime,jdbcType=INTEGER},
|
|
|
open_id = #{openId,jdbcType=VARCHAR},
|
|
|
order_code = #{orderCode,jdbcType=VARCHAR},
|
|
|
miniapp_type = #{miniappType,jdbcType=INTEGER},
|
|
|
uid = #{uid,jdbcType=INTEGER}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|