<?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.homemodule.CommonShareInfoMapper">
|
<resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo">
|
<id column="csi_id" property="id" jdbcType="BIGINT"/>
|
<result column="csi_pid" property="pid" jdbcType="BIGINT"/>
|
<result column="csi_need_spin" property="needSpin" jdbcType="BOOLEAN"/>
|
<result column="csi_comment" property="comment" jdbcType="VARCHAR"/>
|
<result column="csi_createtime" property="createTime" jdbcType="TIMESTAMP"/>
|
<result column="csi_updatetime" property="updateTime" jdbcType="TIMESTAMP"/>
|
<result column="csi_type" property="type" typeHandler="com.yeshi.fanli.util.mybatishandler.CommonShareInfoEnumHandler"/>
|
|
</resultMap>
|
<sql id="Base_Column_List">csi_id,csi_pid,csi_type,csi_need_spin,csi_comment,csi_createtime,csi_updatetime</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
<include refid="Base_Column_List"/>from yeshi_ec_common_share_info where csi_id = #{id,jdbcType=BIGINT}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_common_share_info where csi_id = #{id,jdbcType=BIGINT}</delete>
|
<insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_share_info (csi_id,csi_pid,csi_type,csi_need_spin,csi_comment,csi_createtime,csi_updatetime) values (#{id,jdbcType=BIGINT},#{pid,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{needSpin,jdbcType=BOOLEAN},#{comment,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
|
<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_share_info
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">csi_id,</if>
|
<if test="pid != null">csi_pid,</if>
|
<if test="type != null">csi_type,</if>
|
<if test="needSpin != null">csi_need_spin,</if>
|
<if test="comment != null">csi_comment,</if>
|
<if test="createTime != null">csi_createtime,</if>
|
<if test="updateTime != null">csi_updatetime,</if>
|
</trim>values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="pid != null">#{pid,jdbcType=BIGINT},</if>
|
<if test="type != null">#{type,jdbcType=VARCHAR},</if>
|
<if test="needSpin != null">#{needSpin,jdbcType=BOOLEAN},</if>
|
<if test="comment != null">#{comment,jdbcType=VARCHAR},</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.bus.homemodule.CommonShareInfo">update yeshi_ec_common_share_info set csi_pid = #{pid,jdbcType=BIGINT},csi_type = #{type,jdbcType=VARCHAR},csi_need_spin = #{needSpin,jdbcType=BOOLEAN},csi_comment = #{comment,jdbcType=VARCHAR},csi_createtime = #{createTime,jdbcType=TIMESTAMP},csi_updatetime = #{updateTime,jdbcType=TIMESTAMP} where csi_id = #{id,jdbcType=BIGINT}</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo">update yeshi_ec_common_share_info
|
<set>
|
<if test="pid != null">csi_pid=#{pid,jdbcType=BIGINT},</if>
|
<if test="type != null">csi_type=#{type,jdbcType=VARCHAR},</if>
|
<if test="needSpin != null">csi_need_spin=#{needSpin,jdbcType=BOOLEAN},</if>
|
<if test="comment != null">csi_comment=#{comment,jdbcType=VARCHAR},</if>
|
<if test="createTime != null">csi_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">csi_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
|
</set> where csi_id = #{id,jdbcType=BIGINT}
|
</update>
|
|
<select id="getByPidAndType" resultMap="BaseResultMap">
|
SELECT * FROM yeshi_ec_common_share_info
|
WHERE csi_pid = #{pid} AND csi_type = #{type}
|
ORDER BY csi_id DESC
|
LIMIT 1
|
</select>
|
|
<delete id="deleteByPidAndType">
|
delete from yeshi_ec_common_share_info where csi_pid = #{pid} AND csi_type = #{type}
|
</delete>
|
|
</mapper>
|