123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <?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.dtb.portal.mapper.VipGoodsMapper">
- <insert id="insert">
- insert into t_vpi_goods(id, name, pay_mode, privilege, vip_date, vip_money, create_time, update_time)
- values (#{id}, #{name}, #{payMode}, #{privilege}, #{vipDate}, #{vipMoney}, #{createTime}, #{updateTime})
- </insert>
- <select id="selectByName" resultType="com.dtb.portal.entity.VipGoodsData">
- select *
- from t_vpi_goods
- where 1=1
- <if test="name!=null and name!=''">
- and name = #{name,jdbcType=VARCHAR}
- </if>
- <if test="id!=null and id!=''">
- and id!=#{id,jdbcType=VARCHAR}
- </if>
- </select>
- <update id="update">
- update t_vpi_goods
- <set>
- <if test="name!=null and name!=''">
- name=#{name,jdbcType=VARCHAR},
- </if>
- <if test="payMode!=null and payMode!=''">
- pay_mode=#{payMode,jdbcType=VARCHAR},
- </if>
- <if test="privilege!=null and privilege!=''">
- privilege=#{privilege,jdbcType=VARCHAR},
- </if>
- <if test="vipDate!=null and vipDate!=''">
- vip_date=#{vipDate,jdbcType=VARCHAR},
- </if>
- <if test="vipDate!=null and vipDate!=''">
- vip_money=#{vipMoney,jdbcType=VARCHAR},
- </if>
- <if test="updateTime!=null">
- update_time=#{updateTime,jdbcType=VARCHAR},
- </if>
- </set>
- where id=#{id,jdbcType=VARCHAR}
- </update>
- <delete id="delete">
- delete
- from t_vpi_goods
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <select id="selectById" resultType="com.dtb.portal.entity.VipGoodsData">
- select *
- from t_vpi_goods
- where id = #{id}
- </select>
- <select id="selectPage" resultType="com.dtb.portal.entity.VipGoodsData">
- select * from t_vpi_goods where 1=1
- <if test="name!=null and name!=''">
- and name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="payMode!=null and payMode!=''">
- and pay_mode=#{payMode,jdbcType=VARCHAR}
- </if>
- <if test="privilege!=null and privilege!=''">
- and privilege=#{privilege,jdbcType=VARCHAR}
- </if>
- <if test="vipDate!=null and vipDate!=''">
- and vip_date=#{vipDate,jdbcType=VARCHAR}
- </if>
- <if test="vipDate!=null and vipDate!=''">
- and vip_money=#{vipMoney,jdbcType=VARCHAR}
- </if>
- order by create_time desc
- </select>
- <select id="selectByUserId" resultType="com.dtb.portal.entity.VipUserData">
- select *
- from t_vpi_user
- where user_id = #{userId,jdbcType=VARCHAR} and vip_goods_id=#{vipGoodsId}
- order by t_vpi_user.create_time desc limit 1
- </select>
- <insert id="insertVipUser">
- insert into t_vpi_user (id, user_id, vip_goods_id, vip_start_date, vip_end_date, vip_residue_date, create_time,
- update_time)
- values (#{id}, #{userId}, #{vipGoodsId}, #{vipStartDate}, #{vipEndDate}, #{vipResidueDate}, #{createTime},
- #{updateTime})
- </insert>
- <delete id="deleteVipUser">
- delete
- from t_vpi_user
- where id = #{id}
- </delete>
- <insert id="insertVipOrderData">
- insert into t_vip_order(id, out_trade_no, vip_goods_id, user_id, openid, status, create_time, update_time)
- values (#{id}, #{outTradeNo}, #{vipGoodsId}, #{userId}, #{openid}, #{status}, #{createTime}, #{updateTime})
- </insert>
- <select id="selectByOutTradeNo" resultType="com.dtb.portal.entity.VipOrderData">
- select *
- from t_vip_order
- where out_trade_no = #{outTradeNo}
- </select>
- <update id="updateVipOrderData">
- update t_vip_order
- <set>
- <if test="status!=null and status!=''">
- status=#{status,jdbcType=VARCHAR},
- </if>
- <if test="updateTime!=null">
- update_time=#{updateTime,jdbcType=VARCHAR},
- </if>
- </set>
- where id=#{id,jdbcType=VARCHAR}
- </update>
- </mapper>
|