123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- <?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.juxiao.xchat.module.xbd.mapper.mall.HeadwearMapper" >
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.mall.Headwear" >
- <id column="headwear_id" property="headwearId" jdbcType="INTEGER" />
- <result column="headwear_name" property="headwearName" jdbcType="VARCHAR" />
- <result column="gold_price" property="goldPrice" jdbcType="BIGINT" />
- <result column="seq_no" property="seqNo" jdbcType="INTEGER" />
- <result column="headwear_status" property="headwearStatus" jdbcType="TINYINT" />
- <result column="pic_url" property="picUrl" jdbcType="VARCHAR" />
- <result column="has_gif_pic" property="hasGifPic" jdbcType="BIT" />
- <result column="gif_url" property="gifUrl" jdbcType="VARCHAR" />
- <result column="has_vgg_pic" property="hasVggPic" jdbcType="BIT" />
- <result column="vgg_url" property="vggUrl" jdbcType="VARCHAR" />
- <result column="is_time_limit" property="isTimeLimit" jdbcType="BIT" />
- <result column="effective_time" property="effectiveTime" jdbcType="BIGINT" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="allow_purse" property="allowPurse" jdbcType="TINYINT" />
- <result column="left_level" property="leftLevel" jdbcType="INTEGER" />
- <result column="mark_pic" property="markPic" jdbcType="VARCHAR" />
- <result column="buy_type" property="buyType" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Base_Column_List" >
- headwear_id, headwear_name, gold_price, seq_no, headwear_status, pic_url, has_gif_pic,
- gif_url, has_vgg_pic, vgg_url, is_time_limit, effective_time, create_time, allow_purse,
- left_level, mark_pic,buy_type
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from headwear
- where headwear_id = #{headwearId,jdbcType=INTEGER}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.mall.Headwear" useGeneratedKeys="true" keyProperty="headwearId" keyColumn="headwear_id">
- insert into headwear (headwear_id, headwear_name, gold_price,
- seq_no, headwear_status, pic_url,
- has_gif_pic, gif_url, has_vgg_pic,
- vgg_url, is_time_limit, effective_time,
- create_time, allow_purse, left_level,
- mark_pic)
- values (#{headwearId,jdbcType=INTEGER}, #{headwearName,jdbcType=VARCHAR}, #{goldPrice,jdbcType=BIGINT},
- #{seqNo,jdbcType=INTEGER}, #{headwearStatus,jdbcType=TINYINT}, #{picUrl,jdbcType=VARCHAR},
- #{hasGifPic,jdbcType=BIT}, #{gifUrl,jdbcType=VARCHAR}, #{hasVggPic,jdbcType=BIT},
- #{vggUrl,jdbcType=VARCHAR}, #{isTimeLimit,jdbcType=BIT}, #{effectiveTime,jdbcType=BIGINT},
- #{createTime,jdbcType=TIMESTAMP}, #{allowPurse,jdbcType=TINYINT}, #{leftLevel,jdbcType=INTEGER},
- #{markPic,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.mall.Headwear" useGeneratedKeys="true" keyProperty="headwearId" keyColumn="headwear_id">
- insert into headwear
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="headwearId != null" >
- headwear_id,
- </if>
- <if test="headwearName != null" >
- headwear_name,
- </if>
- <if test="goldPrice != null" >
- gold_price,
- </if>
- <if test="seqNo != null" >
- seq_no,
- </if>
- <if test="headwearStatus != null" >
- headwear_status,
- </if>
- <if test="picUrl != null" >
- pic_url,
- </if>
- <if test="hasGifPic != null" >
- has_gif_pic,
- </if>
- <if test="gifUrl != null" >
- gif_url,
- </if>
- <if test="hasVggPic != null" >
- has_vgg_pic,
- </if>
- <if test="vggUrl != null" >
- vgg_url,
- </if>
- <if test="isTimeLimit != null" >
- is_time_limit,
- </if>
- <if test="effectiveTime != null" >
- effective_time,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- <if test="allowPurse != null" >
- allow_purse,
- </if>
- <if test="leftLevel != null" >
- left_level,
- </if>
- <if test="markPic != null" >
- mark_pic,
- </if>
- <if test="buyType != null" >
- buy_type,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="headwearId != null" >
- #{headwearId,jdbcType=INTEGER},
- </if>
- <if test="headwearName != null" >
- #{headwearName,jdbcType=VARCHAR},
- </if>
- <if test="goldPrice != null" >
- #{goldPrice,jdbcType=BIGINT},
- </if>
- <if test="seqNo != null" >
- #{seqNo,jdbcType=INTEGER},
- </if>
- <if test="headwearStatus != null" >
- #{headwearStatus,jdbcType=TINYINT},
- </if>
- <if test="picUrl != null" >
- #{picUrl,jdbcType=VARCHAR},
- </if>
- <if test="hasGifPic != null" >
- #{hasGifPic,jdbcType=BIT},
- </if>
- <if test="gifUrl != null" >
- #{gifUrl,jdbcType=VARCHAR},
- </if>
- <if test="hasVggPic != null" >
- #{hasVggPic,jdbcType=BIT},
- </if>
- <if test="vggUrl != null" >
- #{vggUrl,jdbcType=VARCHAR},
- </if>
- <if test="isTimeLimit != null" >
- #{isTimeLimit,jdbcType=BIT},
- </if>
- <if test="effectiveTime != null" >
- #{effectiveTime,jdbcType=BIGINT},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="allowPurse != null" >
- #{allowPurse,jdbcType=TINYINT},
- </if>
- <if test="leftLevel != null" >
- #{leftLevel,jdbcType=INTEGER},
- </if>
- <if test="markPic != null" >
- #{markPic,jdbcType=VARCHAR},
- </if>
- <if test="buyType != null" >
- #{buyType,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.mall.Headwear" >
- update headwear
- <set >
- <if test="headwearName != null" >
- headwear_name = #{headwearName,jdbcType=VARCHAR},
- </if>
- <if test="goldPrice != null" >
- gold_price = #{goldPrice,jdbcType=BIGINT},
- </if>
- <if test="seqNo != null" >
- seq_no = #{seqNo,jdbcType=INTEGER},
- </if>
- <if test="headwearStatus != null" >
- headwear_status = #{headwearStatus,jdbcType=TINYINT},
- </if>
- <if test="picUrl != null" >
- pic_url = #{picUrl,jdbcType=VARCHAR},
- </if>
- <if test="hasGifPic != null" >
- has_gif_pic = #{hasGifPic,jdbcType=BIT},
- </if>
- <if test="gifUrl != null" >
- gif_url = #{gifUrl,jdbcType=VARCHAR},
- </if>
- <if test="hasVggPic != null" >
- has_vgg_pic = #{hasVggPic,jdbcType=BIT},
- </if>
- <if test="vggUrl != null" >
- vgg_url = #{vggUrl,jdbcType=VARCHAR},
- </if>
- <if test="isTimeLimit != null" >
- is_time_limit = #{isTimeLimit,jdbcType=BIT},
- </if>
- <if test="effectiveTime != null" >
- effective_time = #{effectiveTime,jdbcType=BIGINT},
- </if>
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="allowPurse != null" >
- allow_purse = #{allowPurse,jdbcType=TINYINT},
- </if>
- <if test="leftLevel != null" >
- left_level = #{leftLevel,jdbcType=INTEGER},
- </if>
- <if test="markPic != null" >
- mark_pic = #{markPic,jdbcType=VARCHAR},
- </if>
- <if test="buyType != null" >
- buy_type = #{buyType,jdbcType=INTEGER},
- </if>
- </set>
- where headwear_id = #{headwearId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.mall.Headwear" >
- update headwear
- set headwear_name = #{headwearName,jdbcType=VARCHAR},
- gold_price = #{goldPrice,jdbcType=BIGINT},
- seq_no = #{seqNo,jdbcType=INTEGER},
- headwear_status = #{headwearStatus,jdbcType=TINYINT},
- pic_url = #{picUrl,jdbcType=VARCHAR},
- has_gif_pic = #{hasGifPic,jdbcType=BIT},
- gif_url = #{gifUrl,jdbcType=VARCHAR},
- has_vgg_pic = #{hasVggPic,jdbcType=BIT},
- vgg_url = #{vggUrl,jdbcType=VARCHAR},
- is_time_limit = #{isTimeLimit,jdbcType=BIT},
- effective_time = #{effectiveTime,jdbcType=BIGINT},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- allow_purse = #{allowPurse,jdbcType=TINYINT},
- left_level = #{leftLevel,jdbcType=INTEGER},
- mark_pic = #{markPic,jdbcType=VARCHAR}
- where headwear_id = #{headwearId,jdbcType=INTEGER}
- </update>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- update headwear set del_flag = 2
- where headwear_id = #{headwearId,jdbcType=INTEGER}
- </delete>
- <select id="selectHeadWearByList" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from headwear
- where del_flag = 1
- <if test="name != null and name != ''">
- and headwear_name LIKE CONCAT('%',#{name},'%')
- </if>
- <if test="status != null">
- and headwear_status = #{status}
- </if>
- <if test="type != null">
- and allow_purse = #{type}
- </if>
- <if test="buyType != null">
- and buy_type = #{buyType}
- </if>
- order by seq_no asc , create_time desc
- </select>
- <select id="selectByHeadWearName" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from headwear
- where del_flag = 1 and headwear_name = #{headWearName}
- </select>
- <delete id="deleteHeadWearByIds" parameterType="java.lang.Long">
- update headwear set del_flag = 2 where headwear_id in
- <foreach collection="array" item="headwearId" open="(" separator="," close=")">
- #{headwearId}
- </foreach>
- </delete>
- <select id="selectHeadWearIdByValid" resultType="java.lang.String">
- SELECT headwear_id FROM headwear WHERE headwear_status = 1 AND del_flag = 1 ORDER BY seq_no ASC
- </select>
- <select id="selectHeadWearIdByValidMall" resultType="java.lang.String">
- SELECT headwear_id FROM headwear WHERE headwear_status = 1 AND del_flag = 1 AND allow_purse = 1 and buy_type = 1 ORDER BY seq_no ASC
- </select>
- <select id="selectHeadWearByValid" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from headwear
- where del_flag = 1 AND headwear_status = 1 and buy_type = 1
- </select>
- <select id="selectHeadWearIdByValidPoint" resultType="java.lang.String">
- SELECT headwear_id FROM headwear WHERE headwear_status = 1 AND del_flag = 1 AND allow_purse = 1 and buy_type = 2 ORDER BY seq_no ASC
- </select>
- </mapper>
|