ProductIntroMapper.xml
1.29 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.product.dal.UfoProductIntroMapper" >
<resultMap id="BaseResultMap" type="com.yoho.product.model.UfoProductIntro" >
<id column="product_id" property="productId" jdbcType="INTEGER" />
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.yoho.product.model.UfoProductIntro" extends="BaseResultMap" >
<result column="product_intro" property="productIntro" jdbcType="LONGVARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
product_id
</sql>
<sql id="Blob_Column_List" >
product_intro
</sql>
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from product_intro
where product_id = #{productId,jdbcType=INTEGER}
</select>
<insert id="insertProductDesc" parameterType="com.yoho.product.model.UfoProductIntro" >
insert into product_intro (product_id, product_intro)
values (#{productId,jdbcType=INTEGER}, #{productIntro,jdbcType=LONGVARCHAR}) ON DUPLICATE KEY UPDATE product_intro=#{productIntro,jdbcType=LONGVARCHAR}
</insert>
</mapper>