123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?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.activity.PointPkMapper" >
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.activity.PointPk" >
- <id column="id" property="id" jdbcType="BIGINT" />
- <result column="term" property="term" jdbcType="INTEGER" />
- <result column="title" property="title" jdbcType="VARCHAR" />
- <result column="red_answer" property="redAnswer" jdbcType="VARCHAR" />
- <result column="blue_answer" property="blueAnswer" jdbcType="VARCHAR" />
- <result column="red_pic" property="redPic" jdbcType="VARCHAR" />
- <result column="blue_pic" property="bluePic" jdbcType="VARCHAR" />
- <result column="red_polls" property="redPolls" jdbcType="INTEGER" />
- <result column="blue_polls" property="bluePolls" jdbcType="INTEGER" />
- <result column="lottery_time" property="lotteryTime" jdbcType="TIMESTAMP" />
- <result column="carve_up_mcoin_num" property="carveUpMcoinNum" jdbcType="INTEGER" />
- <result column="pk_status" property="pkStatus" jdbcType="BIT" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, term, title, red_answer, blue_answer, red_pic, blue_pic, red_polls, blue_polls,
- lottery_time, carve_up_mcoin_num, pk_status, create_time, update_time
- </sql>
- <select id="getPointPkList" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from mcoin_pk_info
- <where>
- <if test="term != null">
- and term = #{term}
- </if>
- <if test="pkStatus != null">
- and pk_status = #{pkStatus}
- </if>
- </where>
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.activity.PointPk" >
- insert into mcoin_pk_info (id, term, title,
- red_answer, blue_answer, red_pic,
- blue_pic, red_polls, blue_polls,
- lottery_time, carve_up_mcoin_num, pk_status,
- create_time, update_time)
- values ((select AUTO_INCREMENT from information_schema.tables where table_name='mcoin_pk_info'),id, #{title,jdbcType=VARCHAR},
- #{redAnswer,jdbcType=VARCHAR}, #{blueAnswer,jdbcType=VARCHAR}, #{redPic,jdbcType=VARCHAR},
- #{bluePic,jdbcType=VARCHAR}, #{redPolls,jdbcType=INTEGER}, #{bluePolls,jdbcType=INTEGER},
- #{lotteryTime,jdbcType=TIMESTAMP}, #{carveUpMcoinNum,jdbcType=INTEGER}, #{pkStatus,jdbcType=BIT},
- #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
- </insert>
- <select id="selectByPkStatus" resultMap="BaseResultMap" parameterType="java.lang.Byte" >
- select
- <include refid="Base_Column_List" />
- from mcoin_pk_info
- where pk_status = #{pkStatus,jdbcType=BIT} limit 1
- </select>
- <select id="selectById" resultMap="BaseResultMap" parameterType="java.lang.Long" >
- select
- <include refid="Base_Column_List" />
- from mcoin_pk_info
- where id = #{id,jdbcType=BIGINT} limit 1
- </select>
- <update id="updateById" parameterType="com.juxiao.xchat.module.xbd.domain.activity.PointPk" >
- update mcoin_pk_info
- set
- title = #{title,jdbcType=VARCHAR},
- red_answer = #{redAnswer,jdbcType=VARCHAR},
- blue_answer = #{blueAnswer,jdbcType=VARCHAR},
- red_pic = #{redPic,jdbcType=VARCHAR},
- blue_pic = #{bluePic,jdbcType=VARCHAR},
- lottery_time = #{lotteryTime,jdbcType=TIMESTAMP},
- pk_status = #{pkStatus,jdbcType=BIT},
- update_time = now()
- where id = #{id,jdbcType=BIGINT}
- </update>
- </mapper>
|