yujian
2020-06-09 554de444b87aab5f93cb1593a8095612cf9479a7
fanli/src/main/java/com/yeshi/fanli/mapping/integral/IntegralTaskMapper.xml
@@ -1,140 +1,140 @@
<?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.yeshi.fanli.dao.mybatis.integral.IntegralTaskMapper">
   <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.integral.IntegralTask">
      <id column="it_id" property="id" jdbcType="BIGINT" />
      <result column="it_name" property="name" jdbcType="VARCHAR" />
      <result column="it_unique_key" property="uniqueKey" jdbcType="VARCHAR" />
      <result column="it_explain" property="explain" jdbcType="VARCHAR" />
      <result column="it_gold_coin" property="goldCoin" jdbcType="INTEGER" />
      <result column="it_upper_limit" property="upperLimit" jdbcType="INTEGER" />
      <result column="it_double_num" property="doubleNum" jdbcType="INTEGER" />
      <result column="it_state" property="state" jdbcType="INTEGER" />
      <result column="it_create_time" property="createTime" jdbcType="TIMESTAMP" />
      <result column="it_update_time" property="updateTime" jdbcType="TIMESTAMP" />
      <result column="it_frequency" property="frequency"
         typeHandler="com.yeshi.fanli.util.mybatishandler.integral.FrequencyEnumHandler" />
      <association property="taskClass" column="it_cid"
         select="com.yeshi.fanli.entity.dao.IntegralTaskClassMapper.selectByPrimaryKey">
      </association>
   </resultMap>
   <resultMap id="SimpleResultMap" type="com.yeshi.fanli.entity.integral.IntegralTask">
      <id column="it_id" property="id" jdbcType="BIGINT" />
      <result column="it_name" property="name" jdbcType="VARCHAR" />
      <result column="it_unique_key" property="uniqueKey" jdbcType="VARCHAR" />
      <result column="it_explain" property="explain" jdbcType="VARCHAR" />
      <result column="it_gold_coin" property="goldCoin" jdbcType="INTEGER" />
      <result column="it_upper_limit" property="upperLimit" jdbcType="INTEGER" />
      <result column="it_double_num" property="doubleNum" jdbcType="INTEGER" />
      <result column="it_state" property="state" jdbcType="INTEGER" />
      <result column="it_create_time" property="createTime" jdbcType="TIMESTAMP" />
      <result column="it_update_time" property="updateTime" jdbcType="TIMESTAMP" />
      <result column="it_frequency" property="frequency"
         typeHandler="com.yeshi.fanli.util.mybatishandler.integral.FrequencyEnumHandler" />
      <association property="taskClass" column="it_cid"
         javaType="com.yeshi.fanli.entity.integral.IntegralTaskClass">
         <id column="it_cid" property="id" jdbcType="BIGINT" />
      </association>
   </resultMap>
   <sql id="Base_Column_List">it_id,it_cid,it_name,it_unique_key,it_explain,it_frequency,it_gold_coin,it_upper_limit,it_double_num,it_state,it_create_time,it_update_time
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap"
      parameterType="java.lang.Long">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_integral_task where it_id = #{id,jdbcType=BIGINT}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
      yeshi_ec_integral_task where it_id = #{id,jdbcType=BIGINT}</delete>
   <insert id="insert" parameterType="com.yeshi.fanli.entity.integral.IntegralTask"
      useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_task
      (it_id,it_cid,it_name,it_unique_key,it_explain,it_frequency,it_gold_coin,it_upper_limit,it_double_num,it_state,it_create_time,it_update_time)
      values
      (#{id,jdbcType=BIGINT},#{taskClass.id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{uniqueKey,jdbcType=VARCHAR},#{explain,jdbcType=VARCHAR},#{frequency,jdbcType=VARCHAR},#{goldCoin,jdbcType=INTEGER},#{upperLimit,jdbcType=INTEGER},#{doubleNum,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTask"
      useGeneratedKeys="true" keyProperty="id">
      insert into yeshi_ec_integral_task
      <trim prefix="(" suffix=")" suffixOverrides=",">
         <if test="id != null">it_id,</if>
         <if test="taskClass != null">it_cid,</if>
         <if test="name != null">it_name,</if>
         <if test="uniqueKey != null">it_unique_key,</if>
         <if test="explain != null">it_explain,</if>
         <if test="frequency != null">it_frequency,</if>
         <if test="goldCoin != null">it_gold_coin,</if>
         <if test="upperLimit != null">it_upper_limit,</if>
         <if test="doubleNum != null">it_double_num,</if>
         <if test="state != null">it_state,</if>
         <if test="createTime != null">it_create_time,</if>
         <if test="updateTime != null">it_update_time,</if>
      </trim>
      values
      <trim prefix="(" suffix=")" suffixOverrides=",">
         <if test="id != null">#{id,jdbcType=BIGINT},</if>
         <if test="taskClass != null">#{taskClass.id,jdbcType=BIGINT},</if>
         <if test="name != null">#{name,jdbcType=VARCHAR},</if>
         <if test="uniqueKey != null">#{uniqueKey,jdbcType=VARCHAR},</if>
         <if test="explain != null">#{explain,jdbcType=VARCHAR},</if>
         <if test="frequency != null">#{frequency,jdbcType=VARCHAR},</if>
         <if test="goldCoin != null">#{goldCoin,jdbcType=INTEGER},</if>
         <if test="upperLimit != null">#{upperLimit,jdbcType=INTEGER},</if>
         <if test="doubleNum != null">#{doubleNum,jdbcType=INTEGER},</if>
         <if test="state != null">#{state,jdbcType=INTEGER},</if>
         <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
         <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
      </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.integral.IntegralTask">update
      yeshi_ec_integral_task set it_cid =
      #{taskClass.id,jdbcType=BIGINT},it_name =
      #{name,jdbcType=VARCHAR},it_unique_key =
      #{uniqueKey,jdbcType=VARCHAR},it_explain =
      #{explain,jdbcType=VARCHAR},it_frequency =
      #{frequency,jdbcType=VARCHAR},it_gold_coin =
      #{goldCoin,jdbcType=INTEGER},it_upper_limit =
      #{upperLimit,jdbcType=INTEGER},it_double_num =
      #{doubleNum,jdbcType=INTEGER},it_state =
      #{state,jdbcType=INTEGER},it_create_time =
      #{createTime,jdbcType=TIMESTAMP},it_update_time =
      #{updateTime,jdbcType=TIMESTAMP} where it_id = #{id,jdbcType=BIGINT}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTask">
      update yeshi_ec_integral_task
      <set>
         <if test="taskClass != null">it_cid=#{taskClass.id,jdbcType=BIGINT},</if>
         <if test="name != null">it_name=#{name,jdbcType=VARCHAR},</if>
         <if test="uniqueKey != null">it_unique_key=#{uniqueKey,jdbcType=VARCHAR},</if>
         <if test="explain != null">it_explain=#{explain,jdbcType=VARCHAR},</if>
         <if test="frequency != null">it_frequency=#{frequency,jdbcType=VARCHAR},</if>
         <if test="goldCoin != null">it_gold_coin=#{goldCoin,jdbcType=INTEGER},</if>
         <if test="upperLimit != null">it_upper_limit=#{upperLimit,jdbcType=INTEGER},</if>
         <if test="doubleNum != null">it_double_num=#{doubleNum,jdbcType=INTEGER},</if>
         <if test="state != null">it_state=#{state,jdbcType=INTEGER},</if>
         <if test="createTime != null">it_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
         <if test="updateTime != null">it_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
      </set>
      where it_id = #{id,jdbcType=BIGINT}
   </update>
   <select id="listByCid" resultMap="SimpleResultMap">
      SELECT * FROM yeshi_ec_integral_task
      WHERE it_state = 1 AND it_cid = #{cid}
   </select>
   <select id="getByCidAndUniqueKey" resultMap="SimpleResultMap">
      SELECT * FROM yeshi_ec_integral_task
      WHERE it_state = 1
      <if test="cid!=null">
         AND it_cid = #{cid}
      </if>
      AND it_unique_key = #{uniqueKey}
      LIMIT 1
   </select>
</mapper>
<?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.yeshi.fanli.dao.mybatis.integral.IntegralTaskMapper">
   <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.integral.IntegralTask">
      <id column="it_id" property="id" jdbcType="BIGINT" />
      <result column="it_name" property="name" jdbcType="VARCHAR" />
      <result column="it_unique_key" property="uniqueKey" jdbcType="VARCHAR" />
      <result column="it_explain" property="explain" jdbcType="VARCHAR" />
      <result column="it_gold_coin" property="goldCoin" jdbcType="INTEGER" />
      <result column="it_upper_limit" property="upperLimit" jdbcType="INTEGER" />
      <result column="it_double_num" property="doubleNum" jdbcType="INTEGER" />
      <result column="it_state" property="state" jdbcType="INTEGER" />
      <result column="it_create_time" property="createTime" jdbcType="TIMESTAMP" />
      <result column="it_update_time" property="updateTime" jdbcType="TIMESTAMP" />
      <result column="it_frequency" property="frequency"
         typeHandler="com.yeshi.fanli.util.mybatishandler.integral.FrequencyEnumHandler" />
      <association property="taskClass" column="it_cid"
         select="com.yeshi.fanli.dao.mybatis.integral.IntegralTaskClassMapper.selectByPrimaryKey">
      </association>
   </resultMap>
   <resultMap id="SimpleResultMap" type="com.yeshi.fanli.entity.integral.IntegralTask">
      <id column="it_id" property="id" jdbcType="BIGINT" />
      <result column="it_name" property="name" jdbcType="VARCHAR" />
      <result column="it_unique_key" property="uniqueKey" jdbcType="VARCHAR" />
      <result column="it_explain" property="explain" jdbcType="VARCHAR" />
      <result column="it_gold_coin" property="goldCoin" jdbcType="INTEGER" />
      <result column="it_upper_limit" property="upperLimit" jdbcType="INTEGER" />
      <result column="it_double_num" property="doubleNum" jdbcType="INTEGER" />
      <result column="it_state" property="state" jdbcType="INTEGER" />
      <result column="it_create_time" property="createTime" jdbcType="TIMESTAMP" />
      <result column="it_update_time" property="updateTime" jdbcType="TIMESTAMP" />
      <result column="it_frequency" property="frequency"
         typeHandler="com.yeshi.fanli.util.mybatishandler.integral.FrequencyEnumHandler" />
      <association property="taskClass" column="it_cid"
         javaType="com.yeshi.fanli.entity.integral.IntegralTaskClass">
         <id column="it_cid" property="id" jdbcType="BIGINT" />
      </association>
   </resultMap>
   <sql id="Base_Column_List">it_id,it_cid,it_name,it_unique_key,it_explain,it_frequency,it_gold_coin,it_upper_limit,it_double_num,it_state,it_create_time,it_update_time
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap"
      parameterType="java.lang.Long">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_integral_task where it_id = #{id,jdbcType=BIGINT}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
      yeshi_ec_integral_task where it_id = #{id,jdbcType=BIGINT}</delete>
   <insert id="insert" parameterType="com.yeshi.fanli.entity.integral.IntegralTask"
      useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_integral_task
      (it_id,it_cid,it_name,it_unique_key,it_explain,it_frequency,it_gold_coin,it_upper_limit,it_double_num,it_state,it_create_time,it_update_time)
      values
      (#{id,jdbcType=BIGINT},#{taskClass.id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{uniqueKey,jdbcType=VARCHAR},#{explain,jdbcType=VARCHAR},#{frequency,jdbcType=VARCHAR},#{goldCoin,jdbcType=INTEGER},#{upperLimit,jdbcType=INTEGER},#{doubleNum,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTask"
      useGeneratedKeys="true" keyProperty="id">
      insert into yeshi_ec_integral_task
      <trim prefix="(" suffix=")" suffixOverrides=",">
         <if test="id != null">it_id,</if>
         <if test="taskClass != null">it_cid,</if>
         <if test="name != null">it_name,</if>
         <if test="uniqueKey != null">it_unique_key,</if>
         <if test="explain != null">it_explain,</if>
         <if test="frequency != null">it_frequency,</if>
         <if test="goldCoin != null">it_gold_coin,</if>
         <if test="upperLimit != null">it_upper_limit,</if>
         <if test="doubleNum != null">it_double_num,</if>
         <if test="state != null">it_state,</if>
         <if test="createTime != null">it_create_time,</if>
         <if test="updateTime != null">it_update_time,</if>
      </trim>
      values
      <trim prefix="(" suffix=")" suffixOverrides=",">
         <if test="id != null">#{id,jdbcType=BIGINT},</if>
         <if test="taskClass != null">#{taskClass.id,jdbcType=BIGINT},</if>
         <if test="name != null">#{name,jdbcType=VARCHAR},</if>
         <if test="uniqueKey != null">#{uniqueKey,jdbcType=VARCHAR},</if>
         <if test="explain != null">#{explain,jdbcType=VARCHAR},</if>
         <if test="frequency != null">#{frequency,jdbcType=VARCHAR},</if>
         <if test="goldCoin != null">#{goldCoin,jdbcType=INTEGER},</if>
         <if test="upperLimit != null">#{upperLimit,jdbcType=INTEGER},</if>
         <if test="doubleNum != null">#{doubleNum,jdbcType=INTEGER},</if>
         <if test="state != null">#{state,jdbcType=INTEGER},</if>
         <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
         <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
      </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.integral.IntegralTask">update
      yeshi_ec_integral_task set it_cid =
      #{taskClass.id,jdbcType=BIGINT},it_name =
      #{name,jdbcType=VARCHAR},it_unique_key =
      #{uniqueKey,jdbcType=VARCHAR},it_explain =
      #{explain,jdbcType=VARCHAR},it_frequency =
      #{frequency,jdbcType=VARCHAR},it_gold_coin =
      #{goldCoin,jdbcType=INTEGER},it_upper_limit =
      #{upperLimit,jdbcType=INTEGER},it_double_num =
      #{doubleNum,jdbcType=INTEGER},it_state =
      #{state,jdbcType=INTEGER},it_create_time =
      #{createTime,jdbcType=TIMESTAMP},it_update_time =
      #{updateTime,jdbcType=TIMESTAMP} where it_id = #{id,jdbcType=BIGINT}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.integral.IntegralTask">
      update yeshi_ec_integral_task
      <set>
         <if test="taskClass != null">it_cid=#{taskClass.id,jdbcType=BIGINT},</if>
         <if test="name != null">it_name=#{name,jdbcType=VARCHAR},</if>
         <if test="uniqueKey != null">it_unique_key=#{uniqueKey,jdbcType=VARCHAR},</if>
         <if test="explain != null">it_explain=#{explain,jdbcType=VARCHAR},</if>
         <if test="frequency != null">it_frequency=#{frequency,jdbcType=VARCHAR},</if>
         <if test="goldCoin != null">it_gold_coin=#{goldCoin,jdbcType=INTEGER},</if>
         <if test="upperLimit != null">it_upper_limit=#{upperLimit,jdbcType=INTEGER},</if>
         <if test="doubleNum != null">it_double_num=#{doubleNum,jdbcType=INTEGER},</if>
         <if test="state != null">it_state=#{state,jdbcType=INTEGER},</if>
         <if test="createTime != null">it_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
         <if test="updateTime != null">it_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
      </set>
      where it_id = #{id,jdbcType=BIGINT}
   </update>
   <select id="listByCid" resultMap="SimpleResultMap">
      SELECT * FROM yeshi_ec_integral_task
      WHERE it_state = 1 AND it_cid = #{cid}
   </select>
   <select id="getByCidAndUniqueKey" resultMap="SimpleResultMap">
      SELECT * FROM yeshi_ec_integral_task
      WHERE it_state = 1
      <if test="cid!=null">
         AND it_cid = #{cid}
      </if>
      AND it_unique_key = #{uniqueKey}
      LIMIT 1
   </select>
</mapper>