LotteryMapper.xml 3.2 KB
<?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.lottery.dal.LotteryMapper">
  <resultMap id="BaseResultMap" type="com.yoho.lottery.dal.model.Lottery">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="start_time" jdbcType="INTEGER" property="startTime" />
    <result column="end_time" jdbcType="INTEGER" property="endTime" />
    <result column="user_limit" jdbcType="INTEGER" property="userLimit" />
    <result column="person_total" jdbcType="INTEGER" property="personTotal" />
    <result column="limit_by_flag" jdbcType="VARCHAR" property="limitByFlag" />
    <result column="probability" jdbcType="INTEGER" property="probability" />
    <result column="pid" jdbcType="INTEGER" property="pid" />
    <result column="create_time" jdbcType="INTEGER" property="createTime" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="image" jdbcType="VARCHAR" property="image" />
  </resultMap>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from lottery
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.yoho.lottery.dal.model.Lottery">
    insert into lottery (id, name, start_time, 
      end_time, user_limit, person_total, 
      limit_by_flag, probability, pid, 
      create_time, status,remark,image)
    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{startTime,jdbcType=INTEGER}, 
      #{endTime,jdbcType=INTEGER}, #{userLimit,jdbcType=INTEGER}, #{personTotal,jdbcType=INTEGER}, 
      #{limitByFlag,jdbcType=VARCHAR}, #{probability,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, 
      #{createTime,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{image,jdbcType=VARCHAR})
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yoho.lottery.dal.model.Lottery">
    update lottery
    set name = #{name,jdbcType=VARCHAR},
      start_time = #{startTime,jdbcType=INTEGER},
      end_time = #{endTime,jdbcType=INTEGER},
      user_limit = #{userLimit,jdbcType=INTEGER},
      person_total = #{personTotal,jdbcType=INTEGER},
      limit_by_flag = #{limitByFlag,jdbcType=VARCHAR},
      probability = #{probability,jdbcType=INTEGER},
      pid = #{pid,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=INTEGER},
      status = #{status,jdbcType=INTEGER},
      remark = #{remark,jdbcType=VARCHAR},
      image = #{image,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select id, name, start_time, end_time, user_limit, person_total, limit_by_flag, probability, 
    pid, create_time, status, remark,image
    from lottery
    where id = #{id,jdbcType=INTEGER}
  </select>
  <select id="selectAll" resultMap="BaseResultMap">
    select id, name, start_time, end_time, user_limit, person_total, limit_by_flag, probability, 
    pid, create_time, status, remark,image
    from lottery
  </select>
</mapper>