feat:把单词导入到数据库
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
<?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.yinlihupo.enlish.service.domain.mapper.VocabularyBankDOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.yinlihupo.enlish.service.domain.dataobject.VocabularyBankDO">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="word" jdbcType="VARCHAR" property="word" />
|
||||
<result column="definition" jdbcType="VARCHAR" property="definition" />
|
||||
<result column="pronunciation" jdbcType="VARCHAR" property="pronunciation" />
|
||||
<result column="unit_id" jdbcType="INTEGER" property="unitId" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, word, `definition`, pronunciation, unit_id
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from vocabulary_bank
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from vocabulary_bank
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
|
||||
<insert id="insert" parameterType="com.yinlihupo.enlish.service.domain.dataobject.VocabularyBankDO">
|
||||
insert into vocabulary_bank (id, word, `definition`, pronunciation, unit_id)
|
||||
values (#{id,jdbcType=INTEGER}, #{word,jdbcType=VARCHAR}, #{definition,jdbcType=VARCHAR},
|
||||
#{pronunciation,jdbcType=VARCHAR}, #{unitId,jdbcType=INTEGER})
|
||||
</insert>
|
||||
|
||||
<insert id="insertSelective" parameterType="com.yinlihupo.enlish.service.domain.dataobject.VocabularyBankDO">
|
||||
insert into vocabulary_bank
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="word != null">
|
||||
word,
|
||||
</if>
|
||||
<if test="definition != null">
|
||||
`definition`,
|
||||
</if>
|
||||
<if test="pronunciation != null">
|
||||
pronunciation,
|
||||
</if>
|
||||
<if test="unitId != null">
|
||||
unit_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="word != null">
|
||||
#{word,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="definition != null">
|
||||
#{definition,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="pronunciation != null">
|
||||
#{pronunciation,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="unitId != null">
|
||||
#{unitId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.yinlihupo.enlish.service.domain.dataobject.VocabularyBankDO">
|
||||
update vocabulary_bank
|
||||
<set>
|
||||
<if test="word != null">
|
||||
word = #{word,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="definition != null">
|
||||
`definition` = #{definition,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="pronunciation != null">
|
||||
pronunciation = #{pronunciation,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="unitId != null">
|
||||
unit_id = #{unitId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<update id="updateByPrimaryKey" parameterType="com.yinlihupo.enlish.service.domain.dataobject.VocabularyBankDO">
|
||||
update vocabulary_bank
|
||||
set word = #{word,jdbcType=VARCHAR},
|
||||
`definition` = #{definition,jdbcType=VARCHAR},
|
||||
pronunciation = #{pronunciation,jdbcType=VARCHAR},
|
||||
unit_id = #{unitId,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user