OrderShareActivityMapper.xml 6.09 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.coupon.dal.IOrderShareActivityDAO">
	<resultMap id="BaseResultMap" type="com.yoho.coupon.dal.model.OrderShareActivity">
		<id column="id" property="id" jdbcType="INTEGER" />
		<result column="activity_name" property="activityName"
			jdbcType="VARCHAR" />
		<result column="show_pic" property="showPic" jdbcType="VARCHAR" />
		<result column="is_show_pic" property="isShowPic" jdbcType="TINYINT" />
		<result column="h5_title" property="h5Title" jdbcType="VARCHAR" />
		<result column="activity_normal_pic" property="activityNormalPic"
			jdbcType="VARCHAR" />
		<result column="activity_end_pic" property="activityEndPic"
			jdbcType="VARCHAR" />
		<result column="share_img_url" property="shareImgUrl" jdbcType="VARCHAR" />
		<result column="share_title" property="shareTitle" jdbcType="VARCHAR" />
		<result column="share_content" property="shareContent"
			jdbcType="VARCHAR" />
		<result column="activity_desc" property="activityDesc"
			jdbcType="VARCHAR" />
		<result column="begin_time" property="beginTime" jdbcType="INTEGER" />
		<result column="end_time" property="endTime" jdbcType="INTEGER" />
		<result column="coupon_pic" property="couponPic" jdbcType="VARCHAR" />
		<result column="old_user_coupon_pic" property="oldUserCouponPic" jdbcType="VARCHAR" />
		<result column="button_link" property="buttonLink" jdbcType="VARCHAR" />
		<result column="create_time" property="createTime" jdbcType="INTEGER" />
		<result column="status" property="status" jdbcType="TINYINT" />
	</resultMap>
	<sql id="Base_Column_List">
		id, activity_name, show_pic, is_show_pic, h5_title, activity_normal_pic, activity_end_pic, share_img_url,
		share_title, share_content, activity_desc, begin_time, end_time,
		coupon_pic,old_user_coupon_pic, button_link,
		create_time,status
	</sql>
	<select id="selectByPrimaryKey" resultMap="BaseResultMap"
		parameterType="java.lang.Integer">
		select
		<include refid="Base_Column_List" />
		from order_share_activity
		where id = #{id,jdbcType=INTEGER}
	</select>
	<select id="selectOne" resultMap="BaseResultMap">
		select
		<include refid="Base_Column_List" />
		from order_share_activity
		where status=1
		limit 1
	</select>
	
	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
		delete from order_share_activity
		where id = #{id,jdbcType=INTEGER}
	</delete>
	<insert id="insert" parameterType="com.yoho.coupon.dal.model.OrderShareActivity">
		insert into order_share_activity (activity_name, show_pic,
		is_show_pic, h5_title,
		activity_normal_pic, activity_end_pic, share_img_url,
		share_title, share_content, activity_desc,
		begin_time, end_time, coupon_pic,old_user_coupon_pic,
		button_link, create_time,status)
		values (#{activityName,jdbcType=VARCHAR},
		#{showPic,jdbcType=VARCHAR},
		#{isShowPic,jdbcType=TINYINT}, #{h5Title,jdbcType=VARCHAR},
		#{activityNormalPic,jdbcType=VARCHAR},
		#{activityEndPic,jdbcType=VARCHAR}, #{shareImgUrl,jdbcType=VARCHAR},
		#{shareTitle,jdbcType=VARCHAR}, #{shareContent,jdbcType=VARCHAR},
		#{activityDesc,jdbcType=VARCHAR},
		#{beginTime,jdbcType=INTEGER}, #{endTime,jdbcType=INTEGER}, #{couponPic,jdbcType=VARCHAR}, #{oldUserCouponPic,jdbcType=VARCHAR},
		#{buttonLink,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER},status)
	</insert>
	<update id="updateByPrimaryKeySelective" parameterType="com.yoho.coupon.dal.model.OrderShareActivity">
		update order_share_activity
		<set>
			<if test="activityName != null">
				activity_name = #{activityName,jdbcType=VARCHAR},
			</if>
			<if test="showPic != null">
				show_pic = #{showPic,jdbcType=VARCHAR},
			</if>
			<if test="isShowPic != null">
				is_show_pic = #{isShowPic,jdbcType=TINYINT},
			</if>
			<if test="h5Title != null">
				h5_title = #{h5Title,jdbcType=VARCHAR},
			</if>
			
			<if test="activityNormalPic != null">
				activity_normal_pic = #{activityNormalPic,jdbcType=VARCHAR},
			</if>
			<if test="activityEndPic != null">
				activity_end_pic = #{activityEndPic,jdbcType=VARCHAR},
			</if>
			<if test="shareImgUrl != null">
				share_img_url = #{shareImgUrl,jdbcType=VARCHAR},
			</if>
			<if test="shareTitle != null">
				share_title = #{shareTitle,jdbcType=VARCHAR},
			</if>
			<if test="shareContent != null">
				share_content = #{shareContent,jdbcType=VARCHAR},
			</if>
			<if test="activityDesc != null">
				activity_desc = #{activityDesc,jdbcType=VARCHAR},
			</if>
			<if test="beginTime != null">
				begin_time = #{beginTime,jdbcType=INTEGER},
			</if>
			<if test="endTime != null">
				end_time = #{endTime,jdbcType=INTEGER},
			</if>
			<if test="couponPic != null">
				coupon_pic = #{couponPic,jdbcType=VARCHAR},
			</if>
			<if test="oldUserCouponPic != null">
				old_user_coupon_pic = #{oldUserCouponPic,jdbcType=VARCHAR},
			</if>
			<if test="buttonLink != null">
				button_link = #{buttonLink,jdbcType=VARCHAR},
			</if>
			<if test="createTime != null">
				create_time = #{createTime,jdbcType=INTEGER},
			</if>
			<if test="status != null">
				status = #{status,jdbcType=INTEGER},
			</if>
		</set>
		where id = #{id,jdbcType=INTEGER}
	</update>
	<update id="updateByPrimaryKey" parameterType="com.yoho.coupon.dal.model.OrderShareActivity">
		update order_share_activity
		set activity_name = #{activityName,jdbcType=VARCHAR},
		show_pic = #{showPic,jdbcType=VARCHAR},
		is_show_pic = #{isShowPic,jdbcType=TINYINT},
		h5_title = #{h5Title,jdbcType=VARCHAR},
		activity_normal_pic = #{activityNormalPic,jdbcType=VARCHAR},
		activity_end_pic = #{activityEndPic,jdbcType=VARCHAR},
		share_img_url = #{shareImgUrl,jdbcType=VARCHAR},
		share_title = #{shareTitle,jdbcType=VARCHAR},
		share_content = #{shareContent,jdbcType=VARCHAR},
		activity_desc = #{activityDesc,jdbcType=VARCHAR},
		begin_time = #{beginTime,jdbcType=INTEGER},
		end_time = #{endTime,jdbcType=INTEGER},
		coupon_pic = #{couponPic,jdbcType=VARCHAR},
		old_user_coupon_pic = #{oldUserCouponPic,jdbcType=VARCHAR},
		button_link = #{buttonLink,jdbcType=VARCHAR},
		create_time = #{createTime,jdbcType=INTEGER},
		status=#{status}
		where id = #{id,jdbcType=INTEGER}
	</update>
</mapper>