mirror of
https://gitee.com/coder-xiaomo/flashsale
synced 2025-01-10 19:58:14 +08:00
抢购2-自动生成数据表映射文件
This commit is contained in:
parent
c52644be19
commit
90cbb3d430
53
src/main/java/com/cxyxiaomo/flashsale/dao/PromoDOMapper.java
Normal file
53
src/main/java/com/cxyxiaomo/flashsale/dao/PromoDOMapper.java
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
package com.cxyxiaomo.flashsale.dao;
|
||||||
|
|
||||||
|
import com.cxyxiaomo.flashsale.dataobject.PromoDO;
|
||||||
|
|
||||||
|
public interface PromoDOMapper {
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method corresponds to the database table promo_info
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method corresponds to the database table promo_info
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
int insert(PromoDO record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method corresponds to the database table promo_info
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
int insertSelective(PromoDO record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method corresponds to the database table promo_info
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
PromoDO selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method corresponds to the database table promo_info
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
int updateByPrimaryKeySelective(PromoDO record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method corresponds to the database table promo_info
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
int updateByPrimaryKey(PromoDO record);
|
||||||
|
}
|
171
src/main/java/com/cxyxiaomo/flashsale/dataobject/PromoDO.java
Normal file
171
src/main/java/com/cxyxiaomo/flashsale/dataobject/PromoDO.java
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
package com.cxyxiaomo.flashsale.dataobject;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class PromoDO {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This field was generated by MyBatis Generator.
|
||||||
|
* This field corresponds to the database column promo_info.id
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This field was generated by MyBatis Generator.
|
||||||
|
* This field corresponds to the database column promo_info.promo_name
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
private String promoName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This field was generated by MyBatis Generator.
|
||||||
|
* This field corresponds to the database column promo_info.start_date
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
private Date startDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This field was generated by MyBatis Generator.
|
||||||
|
* This field corresponds to the database column promo_info.item_id
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
private Integer itemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This field was generated by MyBatis Generator.
|
||||||
|
* This field corresponds to the database column promo_info.prome_item_price
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
private BigDecimal promeItemPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method returns the value of the database column promo_info.id
|
||||||
|
*
|
||||||
|
* @return the value of promo_info.id
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method sets the value of the database column promo_info.id
|
||||||
|
*
|
||||||
|
* @param id the value for promo_info.id
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method returns the value of the database column promo_info.promo_name
|
||||||
|
*
|
||||||
|
* @return the value of promo_info.promo_name
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
public String getPromoName() {
|
||||||
|
return promoName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method sets the value of the database column promo_info.promo_name
|
||||||
|
*
|
||||||
|
* @param promoName the value for promo_info.promo_name
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
public void setPromoName(String promoName) {
|
||||||
|
this.promoName = promoName == null ? null : promoName.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method returns the value of the database column promo_info.start_date
|
||||||
|
*
|
||||||
|
* @return the value of promo_info.start_date
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
public Date getStartDate() {
|
||||||
|
return startDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method sets the value of the database column promo_info.start_date
|
||||||
|
*
|
||||||
|
* @param startDate the value for promo_info.start_date
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
public void setStartDate(Date startDate) {
|
||||||
|
this.startDate = startDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method returns the value of the database column promo_info.item_id
|
||||||
|
*
|
||||||
|
* @return the value of promo_info.item_id
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
public Integer getItemId() {
|
||||||
|
return itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method sets the value of the database column promo_info.item_id
|
||||||
|
*
|
||||||
|
* @param itemId the value for promo_info.item_id
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
public void setItemId(Integer itemId) {
|
||||||
|
this.itemId = itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method returns the value of the database column promo_info.prome_item_price
|
||||||
|
*
|
||||||
|
* @return the value of promo_info.prome_item_price
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
public BigDecimal getPromeItemPrice() {
|
||||||
|
return promeItemPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method was generated by MyBatis Generator.
|
||||||
|
* This method sets the value of the database column promo_info.prome_item_price
|
||||||
|
*
|
||||||
|
* @param promeItemPrice the value for promo_info.prome_item_price
|
||||||
|
*
|
||||||
|
* @mbg.generated Sat Mar 05 12:40:27 CST 2022
|
||||||
|
*/
|
||||||
|
public void setPromeItemPrice(BigDecimal promeItemPrice) {
|
||||||
|
this.promeItemPrice = promeItemPrice;
|
||||||
|
}
|
||||||
|
}
|
133
src/main/resources/mapping/PromoDOMapper.xml
Normal file
133
src/main/resources/mapping/PromoDOMapper.xml
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
<?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.PromoDOMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.cxyxiaomo.flashsale.dataobject.PromoDO">
|
||||||
|
<!--
|
||||||
|
WARNING - @mbg.generated
|
||||||
|
This element is automatically generated by MyBatis Generator, do not modify.
|
||||||
|
This element was generated on Sat Mar 05 12:40:27 CST 2022.
|
||||||
|
-->
|
||||||
|
<id column="id" jdbcType="INTEGER" property="id" />
|
||||||
|
<result column="promo_name" jdbcType="VARCHAR" property="promoName" />
|
||||||
|
<result column="start_date" jdbcType="TIMESTAMP" property="startDate" />
|
||||||
|
<result column="item_id" jdbcType="INTEGER" property="itemId" />
|
||||||
|
<result column="prome_item_price" jdbcType="DECIMAL" property="promeItemPrice" />
|
||||||
|
</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 Sat Mar 05 12:40:27 CST 2022.
|
||||||
|
-->
|
||||||
|
id, promo_name, start_date, item_id, prome_item_price
|
||||||
|
</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 Sat Mar 05 12:40:27 CST 2022.
|
||||||
|
-->
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from promo_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 Sat Mar 05 12:40:27 CST 2022.
|
||||||
|
-->
|
||||||
|
delete from promo_info
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" parameterType="com.cxyxiaomo.flashsale.dataobject.PromoDO">
|
||||||
|
<!--
|
||||||
|
WARNING - @mbg.generated
|
||||||
|
This element is automatically generated by MyBatis Generator, do not modify.
|
||||||
|
This element was generated on Sat Mar 05 12:40:27 CST 2022.
|
||||||
|
-->
|
||||||
|
insert into promo_info (id, promo_name, start_date,
|
||||||
|
item_id, prome_item_price)
|
||||||
|
values (#{id,jdbcType=INTEGER}, #{promoName,jdbcType=VARCHAR}, #{startDate,jdbcType=TIMESTAMP},
|
||||||
|
#{itemId,jdbcType=INTEGER}, #{promeItemPrice,jdbcType=DECIMAL})
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" parameterType="com.cxyxiaomo.flashsale.dataobject.PromoDO">
|
||||||
|
<!--
|
||||||
|
WARNING - @mbg.generated
|
||||||
|
This element is automatically generated by MyBatis Generator, do not modify.
|
||||||
|
This element was generated on Sat Mar 05 12:40:27 CST 2022.
|
||||||
|
-->
|
||||||
|
insert into promo_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="promoName != null">
|
||||||
|
promo_name,
|
||||||
|
</if>
|
||||||
|
<if test="startDate != null">
|
||||||
|
start_date,
|
||||||
|
</if>
|
||||||
|
<if test="itemId != null">
|
||||||
|
item_id,
|
||||||
|
</if>
|
||||||
|
<if test="promeItemPrice != null">
|
||||||
|
prome_item_price,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="promoName != null">
|
||||||
|
#{promoName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="startDate != null">
|
||||||
|
#{startDate,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="itemId != null">
|
||||||
|
#{itemId,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="promeItemPrice != null">
|
||||||
|
#{promeItemPrice,jdbcType=DECIMAL},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.cxyxiaomo.flashsale.dataobject.PromoDO">
|
||||||
|
<!--
|
||||||
|
WARNING - @mbg.generated
|
||||||
|
This element is automatically generated by MyBatis Generator, do not modify.
|
||||||
|
This element was generated on Sat Mar 05 12:40:27 CST 2022.
|
||||||
|
-->
|
||||||
|
update promo_info
|
||||||
|
<set>
|
||||||
|
<if test="promoName != null">
|
||||||
|
promo_name = #{promoName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="startDate != null">
|
||||||
|
start_date = #{startDate,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="itemId != null">
|
||||||
|
item_id = #{itemId,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="promeItemPrice != null">
|
||||||
|
prome_item_price = #{promeItemPrice,jdbcType=DECIMAL},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKey" parameterType="com.cxyxiaomo.flashsale.dataobject.PromoDO">
|
||||||
|
<!--
|
||||||
|
WARNING - @mbg.generated
|
||||||
|
This element is automatically generated by MyBatis Generator, do not modify.
|
||||||
|
This element was generated on Sat Mar 05 12:40:27 CST 2022.
|
||||||
|
-->
|
||||||
|
update promo_info
|
||||||
|
set promo_name = #{promoName,jdbcType=VARCHAR},
|
||||||
|
start_date = #{startDate,jdbcType=TIMESTAMP},
|
||||||
|
item_id = #{itemId,jdbcType=INTEGER},
|
||||||
|
prome_item_price = #{promeItemPrice,jdbcType=DECIMAL}
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
@ -59,6 +59,9 @@
|
|||||||
<!--<table tableName="sequence_info" domainObjectName="SequenceDO" enableCountByExample="false"-->
|
<!--<table tableName="sequence_info" domainObjectName="SequenceDO" enableCountByExample="false"-->
|
||||||
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
|
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
|
||||||
<!-- selectByExampleQueryId="false"></table>-->
|
<!-- selectByExampleQueryId="false"></table>-->
|
||||||
|
<table tableName="promo_info" domainObjectName="PromoDO" enableCountByExample="false"
|
||||||
|
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
|
||||||
|
selectByExampleQueryId="false"></table>
|
||||||
|
|
||||||
</context>
|
</context>
|
||||||
</generatorConfiguration>
|
</generatorConfiguration>
|
Loading…
Reference in New Issue
Block a user