<?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.activity.RecommendActivityImgMapper">
|
<resultMap id="BaseResultMap"
|
type="com.yeshi.fanli.entity.bus.activity.RecommendActivityImg">
|
<id column="ai_id" property="id" jdbcType="BIGINT" />
|
<result column="ai_img" property="img" jdbcType="VARCHAR" />
|
<result column="ai_orderby" property="orderBy" jdbcType="INTEGER" />
|
<result column="ai_img_height" property="imgHeight" jdbcType="INTEGER" />
|
<result column="ai_img_width" property="imgWidth" jdbcType="INTEGER" />
|
<association property="recommendActivity" column="ai_activity_id"
|
resultMap="com.yeshi.fanli.dao.mybatis.activity.RecommendActivityMapper.BaseResultMap" />
|
|
</resultMap>
|
<sql id="Base_Column_List">ai_id,ai_activity_id as
|
ar_id,ai_img,ai_orderby,ai_activity_id,ai_img_height,ai_img_width
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_activity_img where ai_id = #{id,jdbcType=BIGINT}
|
</select>
|
<select id="getImgByActivityId" resultType="java.lang.String"
|
parameterType="java.lang.Long">select ai_img from yeshi_ec_activity_img where
|
ai_activity_id = #{0} order by ai_orderby
|
</select>
|
|
<select id="getImgWithAndHeightByActivityId" resultType="java.lang.String"
|
parameterType="java.lang.Long">select concat(ai_img_width,'#',ai_img_height) from yeshi_ec_activity_img where
|
ai_activity_id = #{0} order by ai_orderby
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_activity_img where ai_id = #{id,jdbcType=BIGINT}
|
</delete>
|
<delete id="batchDeleteByActivityid" parameterType="int">
|
<!-- 批量删除 -->
|
delete from yeshi_ec_activity_img where ai_activity_id in
|
<foreach item="arids" collection="array" open="(" separator=","
|
close=")">#{arids}</foreach>
|
</delete>
|
<insert id="insert"
|
parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivityImg"
|
useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_activity_img
|
(ai_id,ai_activity_id,ai_img,ai_orderby,ai_img_height,ai_img_width)
|
values
|
(#{id,jdbcType=BIGINT},#{recommendActivity.id,jdbcType=BIGINT},#{img,jdbcType=VARCHAR},#{orderBy,jdbcType=INTEGER},#{imgHeight,jdbcType=INTEGER},#{imgWidth,jdbcType=INTEGER})
|
</insert>
|
<insert id="insertSelective"
|
parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivityImg"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_activity_img
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">ai_id,</if>
|
<if test="recommendActivity != null">ai_activity_id,</if>
|
<if test="img != null">ai_img,</if>
|
<if test="orderBy != null">ai_orderby,</if>
|
<if test="imgHeight != null">ai_img_height,</if>
|
<if test="imgWidth != null">ai_img_width,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="recommendActivity != null">#{recommendActivity.id,jdbcType=BIGINT},</if>
|
<if test="img != null">#{img,jdbcType=VARCHAR},</if>
|
<if test="orderBy != null">#{orderBy,jdbcType=INTEGER},</if>
|
<if test="imgHeight != null">#{imgHeight,jdbcType=INTEGER},</if>
|
<if test="imgWidth != null">#{imgWidth,jdbcType=INTEGER}</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey"
|
parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivityImg">update yeshi_ec_activity_img set ai_activity_id =
|
#{recommendActivity.id,jdbcType=BIGINT},ai_img =
|
#{img,jdbcType=VARCHAR},ai_orderby = #{orderBy,jdbcType=INTEGER}
|
,ai_img_height =#{imgHeight,jdbcType=INTEGER} ,ai_img_width
|
=#{imgWidth,jdbcType=INTEGER} where ai_id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective"
|
parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivityImg">
|
update yeshi_ec_activity_img
|
<set>
|
<if test="recommendActivity != null">ai_activity_id=#{recommendActivity.id,jdbcType=BIGINT},
|
</if>
|
<if test="img != null">ai_img=#{img,jdbcType=VARCHAR},</if>
|
<if test="orderBy != null">ai_orderby=#{orderBy,jdbcType=INTEGER},</if>
|
<if test="id !=null">ai_id =#{id,jdbcType=BIGINT},</if>
|
<if test="imgHeight !=null">ai_img_height =#{imgHeight,jdbcType=INTEGER},</if>
|
<if test="imgWidth !=null">ai_img_width =#{imgWidth,jdbcType=INTEGER},</if>
|
</set>
|
where ai_id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|