1
0
mirror of https://gitee.com/coder-xiaomo/flashsale synced 2025-09-12 23:11:38 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
flashsale/src/main/resources/mapping/ItemDOMapper.xml

146 lines
5.2 KiB
XML

<?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.cxyxiaomo.flashsale.dao.ItemDOMapper">
<resultMap id="BaseResultMap" type="com.cxyxiaomo.flashsale.dataobject.ItemDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Thu Mar 03 13:12:13 CST 2022.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="price" jdbcType="DECIMAL" property="price" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="sales" jdbcType="INTEGER" property="sales" />
<result column="img_url" jdbcType="VARCHAR" property="imgUrl" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Thu Mar 03 13:12:13 CST 2022.
-->
id, title, price, description, sales, img_url
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Thu Mar 03 13:12:13 CST 2022.
-->
select
<include refid="Base_Column_List" />
from item_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Thu Mar 03 13:12:13 CST 2022.
-->
delete from item_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.cxyxiaomo.flashsale.dataobject.ItemDO" useGeneratedKeys="true" keyProperty="id">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Thu Mar 03 13:12:13 CST 2022.
-->
insert into item_info (id, title, price,
description, sales, img_url
)
values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL},
#{description,jdbcType=VARCHAR}, #{sales,jdbcType=INTEGER}, #{imgUrl,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.cxyxiaomo.flashsale.dataobject.ItemDO" useGeneratedKeys="true" keyProperty="id">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Thu Mar 03 13:12:13 CST 2022.
-->
insert into item_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="title != null">
title,
</if>
<if test="price != null">
price,
</if>
<if test="description != null">
description,
</if>
<if test="sales != null">
sales,
</if>
<if test="imgUrl != null">
img_url,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="price != null">
#{price,jdbcType=DECIMAL},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="sales != null">
#{sales,jdbcType=INTEGER},
</if>
<if test="imgUrl != null">
#{imgUrl,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cxyxiaomo.flashsale.dataobject.ItemDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Thu Mar 03 13:12:13 CST 2022.
-->
update item_info
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="price != null">
price = #{price,jdbcType=DECIMAL},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="sales != null">
sales = #{sales,jdbcType=INTEGER},
</if>
<if test="imgUrl != null">
img_url = #{imgUrl,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.cxyxiaomo.flashsale.dataobject.ItemDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Thu Mar 03 13:12:13 CST 2022.
-->
update item_info
set title = #{title,jdbcType=VARCHAR},
price = #{price,jdbcType=DECIMAL},
description = #{description,jdbcType=VARCHAR},
sales = #{sales,jdbcType=INTEGER},
img_url = #{imgUrl,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>