移植原始版本

This commit is contained in:
yutou
2021-04-07 14:52:03 +08:00
parent 70798c5e94
commit 5d5a4eef97
59 changed files with 9390 additions and 0 deletions

View File

@@ -0,0 +1,220 @@
<?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.yutou.nas.mybatis.dao.BangumiItemDao">
<resultMap id="BaseResultMap" type="com.yutou.nas.mybatis.model.BangumiItem">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="bid" jdbcType="VARCHAR" property="bid" />
<result column="categories" jdbcType="VARCHAR" property="categories" />
<result column="author" jdbcType="VARCHAR" property="author" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="titleKey" jdbcType="VARCHAR" property="titlekey" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, bid, categories, author, title, titleKey
</sql>
<select id="selectByExample" parameterType="com.yutou.nas.mybatis.model.BangumiItemExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from bangumi_item
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from bangumi_item
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from bangumi_item
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.yutou.nas.mybatis.model.BangumiItemExample">
delete from bangumi_item
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.nas.mybatis.model.BangumiItem" useGeneratedKeys="true">
insert into bangumi_item (bid, categories, author,
title, titleKey)
values (#{bid,jdbcType=VARCHAR}, #{categories,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR},
#{title,jdbcType=VARCHAR}, #{titlekey,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.nas.mybatis.model.BangumiItem" useGeneratedKeys="true">
insert into bangumi_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="bid != null">
bid,
</if>
<if test="categories != null">
categories,
</if>
<if test="author != null">
author,
</if>
<if test="title != null">
title,
</if>
<if test="titlekey != null">
titleKey,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="bid != null">
#{bid,jdbcType=VARCHAR},
</if>
<if test="categories != null">
#{categories,jdbcType=VARCHAR},
</if>
<if test="author != null">
#{author,jdbcType=VARCHAR},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="titlekey != null">
#{titlekey,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.yutou.nas.mybatis.model.BangumiItemExample" resultType="java.lang.Long">
select count(*) from bangumi_item
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update bangumi_item
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.bid != null">
bid = #{record.bid,jdbcType=VARCHAR},
</if>
<if test="record.categories != null">
categories = #{record.categories,jdbcType=VARCHAR},
</if>
<if test="record.author != null">
author = #{record.author,jdbcType=VARCHAR},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.titlekey != null">
titleKey = #{record.titlekey,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update bangumi_item
set id = #{record.id,jdbcType=INTEGER},
bid = #{record.bid,jdbcType=VARCHAR},
categories = #{record.categories,jdbcType=VARCHAR},
author = #{record.author,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
titleKey = #{record.titlekey,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.yutou.nas.mybatis.model.BangumiItem">
update bangumi_item
<set>
<if test="bid != null">
bid = #{bid,jdbcType=VARCHAR},
</if>
<if test="categories != null">
categories = #{categories,jdbcType=VARCHAR},
</if>
<if test="author != null">
author = #{author,jdbcType=VARCHAR},
</if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="titlekey != null">
titleKey = #{titlekey,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yutou.nas.mybatis.model.BangumiItem">
update bangumi_item
set bid = #{bid,jdbcType=VARCHAR},
categories = #{categories,jdbcType=VARCHAR},
author = #{author,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
titleKey = #{titlekey,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -0,0 +1,173 @@
<?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.yutou.nas.mybatis.dao.BangumiListDao">
<resultMap id="BaseResultMap" type="com.yutou.nas.mybatis.model.BangumiList">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, title, `status`
</sql>
<select id="selectByExample" parameterType="com.yutou.nas.mybatis.model.BangumiListExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from bangumi_list
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from bangumi_list
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from bangumi_list
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.yutou.nas.mybatis.model.BangumiListExample">
delete from bangumi_list
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.nas.mybatis.model.BangumiList" useGeneratedKeys="true">
insert into bangumi_list (title, `status`)
values (#{title,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.nas.mybatis.model.BangumiList" useGeneratedKeys="true">
insert into bangumi_list
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null">
title,
</if>
<if test="status != null">
`status`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.yutou.nas.mybatis.model.BangumiListExample" resultType="java.lang.Long">
select count(*) from bangumi_list
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update bangumi_list
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update bangumi_list
set id = #{record.id,jdbcType=INTEGER},
title = #{record.title,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.yutou.nas.mybatis.model.BangumiList">
update bangumi_list
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yutou.nas.mybatis.model.BangumiList">
update bangumi_list
set title = #{title,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -0,0 +1,496 @@
<?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.yutou.nas.mybatis.dao.MusicDataDao">
<resultMap id="BaseResultMap" type="com.yutou.nas.mybatis.model.MusicData">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="artist" jdbcType="VARCHAR" property="artist" />
<result column="album" jdbcType="VARCHAR" property="album" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="comment" jdbcType="VARCHAR" property="comment" />
<result column="year" jdbcType="VARCHAR" property="year" />
<result column="track" jdbcType="VARCHAR" property="track" />
<result column="disc_no" jdbcType="VARCHAR" property="discNo" />
<result column="composer" jdbcType="VARCHAR" property="composer" />
<result column="artist_sort" jdbcType="VARCHAR" property="artistSort" />
<result column="file" jdbcType="VARCHAR" property="file" />
<result column="lastDir" jdbcType="VARCHAR" property="lastdir" />
<result column="isDir" jdbcType="INTEGER" property="isdir" />
<result column="bitRate" jdbcType="INTEGER" property="bitrate" />
<result column="sampleRate" jdbcType="INTEGER" property="samplerate" />
<result column="noOfSamples" jdbcType="BIGINT" property="noofsamples" />
<result column="channelCount" jdbcType="INTEGER" property="channelcount" />
<result column="encodingType" jdbcType="VARCHAR" property="encodingtype" />
<result column="durationAsDouble" jdbcType="DOUBLE" property="durationasdouble" />
<result column="lossless" jdbcType="INTEGER" property="lossless" />
<result column="variableBitRate" jdbcType="INTEGER" property="variablebitrate" />
<result column="md5" jdbcType="VARCHAR" property="md5" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, artist, album, title, `comment`, `year`, track, disc_no, composer, artist_sort,
`file`, lastDir, isDir, bitRate, sampleRate, noOfSamples, channelCount, encodingType,
durationAsDouble, lossless, variableBitRate, md5
</sql>
<select id="selectByExample" parameterType="com.yutou.nas.mybatis.model.MusicDataExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from music_data
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from music_data
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from music_data
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.yutou.nas.mybatis.model.MusicDataExample">
delete from music_data
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.nas.mybatis.model.MusicData" useGeneratedKeys="true">
insert into music_data (artist, album, title,
`comment`, `year`, track,
disc_no, composer, artist_sort,
`file`, lastDir, isDir,
bitRate, sampleRate, noOfSamples,
channelCount, encodingType, durationAsDouble,
lossless, variableBitRate, md5
)
values (#{artist,jdbcType=VARCHAR}, #{album,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
#{comment,jdbcType=VARCHAR}, #{year,jdbcType=VARCHAR}, #{track,jdbcType=VARCHAR},
#{discNo,jdbcType=VARCHAR}, #{composer,jdbcType=VARCHAR}, #{artistSort,jdbcType=VARCHAR},
#{file,jdbcType=VARCHAR}, #{lastdir,jdbcType=VARCHAR}, #{isdir,jdbcType=INTEGER},
#{bitrate,jdbcType=INTEGER}, #{samplerate,jdbcType=INTEGER}, #{noofsamples,jdbcType=BIGINT},
#{channelcount,jdbcType=INTEGER}, #{encodingtype,jdbcType=VARCHAR}, #{durationasdouble,jdbcType=DOUBLE},
#{lossless,jdbcType=INTEGER}, #{variablebitrate,jdbcType=INTEGER}, #{md5,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.nas.mybatis.model.MusicData" useGeneratedKeys="true">
insert into music_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="artist != null">
artist,
</if>
<if test="album != null">
album,
</if>
<if test="title != null">
title,
</if>
<if test="comment != null">
`comment`,
</if>
<if test="year != null">
`year`,
</if>
<if test="track != null">
track,
</if>
<if test="discNo != null">
disc_no,
</if>
<if test="composer != null">
composer,
</if>
<if test="artistSort != null">
artist_sort,
</if>
<if test="file != null">
`file`,
</if>
<if test="lastdir != null">
lastDir,
</if>
<if test="isdir != null">
isDir,
</if>
<if test="bitrate != null">
bitRate,
</if>
<if test="samplerate != null">
sampleRate,
</if>
<if test="noofsamples != null">
noOfSamples,
</if>
<if test="channelcount != null">
channelCount,
</if>
<if test="encodingtype != null">
encodingType,
</if>
<if test="durationasdouble != null">
durationAsDouble,
</if>
<if test="lossless != null">
lossless,
</if>
<if test="variablebitrate != null">
variableBitRate,
</if>
<if test="md5 != null">
md5,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="artist != null">
#{artist,jdbcType=VARCHAR},
</if>
<if test="album != null">
#{album,jdbcType=VARCHAR},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="comment != null">
#{comment,jdbcType=VARCHAR},
</if>
<if test="year != null">
#{year,jdbcType=VARCHAR},
</if>
<if test="track != null">
#{track,jdbcType=VARCHAR},
</if>
<if test="discNo != null">
#{discNo,jdbcType=VARCHAR},
</if>
<if test="composer != null">
#{composer,jdbcType=VARCHAR},
</if>
<if test="artistSort != null">
#{artistSort,jdbcType=VARCHAR},
</if>
<if test="file != null">
#{file,jdbcType=VARCHAR},
</if>
<if test="lastdir != null">
#{lastdir,jdbcType=VARCHAR},
</if>
<if test="isdir != null">
#{isdir,jdbcType=INTEGER},
</if>
<if test="bitrate != null">
#{bitrate,jdbcType=INTEGER},
</if>
<if test="samplerate != null">
#{samplerate,jdbcType=INTEGER},
</if>
<if test="noofsamples != null">
#{noofsamples,jdbcType=BIGINT},
</if>
<if test="channelcount != null">
#{channelcount,jdbcType=INTEGER},
</if>
<if test="encodingtype != null">
#{encodingtype,jdbcType=VARCHAR},
</if>
<if test="durationasdouble != null">
#{durationasdouble,jdbcType=DOUBLE},
</if>
<if test="lossless != null">
#{lossless,jdbcType=INTEGER},
</if>
<if test="variablebitrate != null">
#{variablebitrate,jdbcType=INTEGER},
</if>
<if test="md5 != null">
#{md5,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.yutou.nas.mybatis.model.MusicDataExample" resultType="java.lang.Long">
select count(*) from music_data
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<select id="selectByRegexp" resultType="com.yutou.nas.mybatis.model.MusicData">
select * from music_data where `file` REGEXP #{regexp,jdbcType=VARCHAR}
</select>
<select id="selectAllAlbum" resultType="java.lang.String">
SELECT album FROM music_data group by `album`;
</select>
<select id="selectAllArtist" resultType="java.lang.String">
SELECT artist FROM music_data group by `artist`;
</select>
<select id="selectAlbum" resultType="com.yutou.nas.mybatis.model.MusicData">
select
<include refid="Base_Column_List" />
from music_data where `album`= #{album,jdbcType=VARCHAR}
</select>
<select id="selectArtist" resultType="com.yutou.nas.mybatis.model.MusicData">
select
<include refid="Base_Column_List" />
from music_data where `artist`= #{artist,jdbcType=VARCHAR}
</select>
<update id="updateByExampleSelective" parameterType="map">
update music_data
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.artist != null">
artist = #{record.artist,jdbcType=VARCHAR},
</if>
<if test="record.album != null">
album = #{record.album,jdbcType=VARCHAR},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.comment != null">
`comment` = #{record.comment,jdbcType=VARCHAR},
</if>
<if test="record.year != null">
`year` = #{record.year,jdbcType=VARCHAR},
</if>
<if test="record.track != null">
track = #{record.track,jdbcType=VARCHAR},
</if>
<if test="record.discNo != null">
disc_no = #{record.discNo,jdbcType=VARCHAR},
</if>
<if test="record.composer != null">
composer = #{record.composer,jdbcType=VARCHAR},
</if>
<if test="record.artistSort != null">
artist_sort = #{record.artistSort,jdbcType=VARCHAR},
</if>
<if test="record.file != null">
`file` = #{record.file,jdbcType=VARCHAR},
</if>
<if test="record.lastdir != null">
lastDir = #{record.lastdir,jdbcType=VARCHAR},
</if>
<if test="record.isdir != null">
isDir = #{record.isdir,jdbcType=INTEGER},
</if>
<if test="record.bitrate != null">
bitRate = #{record.bitrate,jdbcType=INTEGER},
</if>
<if test="record.samplerate != null">
sampleRate = #{record.samplerate,jdbcType=INTEGER},
</if>
<if test="record.noofsamples != null">
noOfSamples = #{record.noofsamples,jdbcType=BIGINT},
</if>
<if test="record.channelcount != null">
channelCount = #{record.channelcount,jdbcType=INTEGER},
</if>
<if test="record.encodingtype != null">
encodingType = #{record.encodingtype,jdbcType=VARCHAR},
</if>
<if test="record.durationasdouble != null">
durationAsDouble = #{record.durationasdouble,jdbcType=DOUBLE},
</if>
<if test="record.lossless != null">
lossless = #{record.lossless,jdbcType=INTEGER},
</if>
<if test="record.variablebitrate != null">
variableBitRate = #{record.variablebitrate,jdbcType=INTEGER},
</if>
<if test="record.md5 != null">
md5 = #{record.md5,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update music_data
set id = #{record.id,jdbcType=INTEGER},
artist = #{record.artist,jdbcType=VARCHAR},
album = #{record.album,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
`comment` = #{record.comment,jdbcType=VARCHAR},
`year` = #{record.year,jdbcType=VARCHAR},
track = #{record.track,jdbcType=VARCHAR},
disc_no = #{record.discNo,jdbcType=VARCHAR},
composer = #{record.composer,jdbcType=VARCHAR},
artist_sort = #{record.artistSort,jdbcType=VARCHAR},
`file` = #{record.file,jdbcType=VARCHAR},
lastDir = #{record.lastdir,jdbcType=VARCHAR},
isDir = #{record.isdir,jdbcType=INTEGER},
bitRate = #{record.bitrate,jdbcType=INTEGER},
sampleRate = #{record.samplerate,jdbcType=INTEGER},
noOfSamples = #{record.noofsamples,jdbcType=BIGINT},
channelCount = #{record.channelcount,jdbcType=INTEGER},
encodingType = #{record.encodingtype,jdbcType=VARCHAR},
durationAsDouble = #{record.durationasdouble,jdbcType=DOUBLE},
lossless = #{record.lossless,jdbcType=INTEGER},
variableBitRate = #{record.variablebitrate,jdbcType=INTEGER},
md5 = #{record.md5,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.yutou.nas.mybatis.model.MusicData">
update music_data
<set>
<if test="artist != null">
artist = #{artist,jdbcType=VARCHAR},
</if>
<if test="album != null">
album = #{album,jdbcType=VARCHAR},
</if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="comment != null">
`comment` = #{comment,jdbcType=VARCHAR},
</if>
<if test="year != null">
`year` = #{year,jdbcType=VARCHAR},
</if>
<if test="track != null">
track = #{track,jdbcType=VARCHAR},
</if>
<if test="discNo != null">
disc_no = #{discNo,jdbcType=VARCHAR},
</if>
<if test="composer != null">
composer = #{composer,jdbcType=VARCHAR},
</if>
<if test="artistSort != null">
artist_sort = #{artistSort,jdbcType=VARCHAR},
</if>
<if test="file != null">
`file` = #{file,jdbcType=VARCHAR},
</if>
<if test="lastdir != null">
lastDir = #{lastdir,jdbcType=VARCHAR},
</if>
<if test="isdir != null">
isDir = #{isdir,jdbcType=INTEGER},
</if>
<if test="bitrate != null">
bitRate = #{bitrate,jdbcType=INTEGER},
</if>
<if test="samplerate != null">
sampleRate = #{samplerate,jdbcType=INTEGER},
</if>
<if test="noofsamples != null">
noOfSamples = #{noofsamples,jdbcType=BIGINT},
</if>
<if test="channelcount != null">
channelCount = #{channelcount,jdbcType=INTEGER},
</if>
<if test="encodingtype != null">
encodingType = #{encodingtype,jdbcType=VARCHAR},
</if>
<if test="durationasdouble != null">
durationAsDouble = #{durationasdouble,jdbcType=DOUBLE},
</if>
<if test="lossless != null">
lossless = #{lossless,jdbcType=INTEGER},
</if>
<if test="variablebitrate != null">
variableBitRate = #{variablebitrate,jdbcType=INTEGER},
</if>
<if test="md5 != null">
md5 = #{md5,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yutou.nas.mybatis.model.MusicData">
update music_data
set artist = #{artist,jdbcType=VARCHAR},
album = #{album,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
`comment` = #{comment,jdbcType=VARCHAR},
`year` = #{year,jdbcType=VARCHAR},
track = #{track,jdbcType=VARCHAR},
disc_no = #{discNo,jdbcType=VARCHAR},
composer = #{composer,jdbcType=VARCHAR},
artist_sort = #{artistSort,jdbcType=VARCHAR},
`file` = #{file,jdbcType=VARCHAR},
lastDir = #{lastdir,jdbcType=VARCHAR},
isDir = #{isdir,jdbcType=INTEGER},
bitRate = #{bitrate,jdbcType=INTEGER},
sampleRate = #{samplerate,jdbcType=INTEGER},
noOfSamples = #{noofsamples,jdbcType=BIGINT},
channelCount = #{channelcount,jdbcType=INTEGER},
encodingType = #{encodingtype,jdbcType=VARCHAR},
durationAsDouble = #{durationasdouble,jdbcType=DOUBLE},
lossless = #{lossless,jdbcType=INTEGER},
variableBitRate = #{variablebitrate,jdbcType=INTEGER},
md5 = #{md5,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="truncate">
TRUNCATE music_data;
</update>
</mapper>

View File

@@ -0,0 +1,190 @@
<?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.yutou.nas.mybatis.dao.MusicFavoritesDao">
<resultMap id="BaseResultMap" type="com.yutou.nas.mybatis.model.MusicFavorites">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="favoriteId" jdbcType="INTEGER" property="favoriteid" />
<result column="musis_md5" jdbcType="VARCHAR" property="musisMd5" />
<result column="sub_time" jdbcType="TIMESTAMP" property="subTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, favoriteId, musis_md5, sub_time
</sql>
<select id="selectByExample" parameterType="com.yutou.nas.mybatis.model.MusicFavoritesExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from music_favorites
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from music_favorites
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from music_favorites
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.yutou.nas.mybatis.model.MusicFavoritesExample">
delete from music_favorites
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.nas.mybatis.model.MusicFavorites" useGeneratedKeys="true">
insert into music_favorites (favoriteId, musis_md5, sub_time
)
values (#{favoriteid,jdbcType=INTEGER}, #{musisMd5,jdbcType=VARCHAR}, #{subTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.nas.mybatis.model.MusicFavorites" useGeneratedKeys="true">
insert into music_favorites
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="favoriteid != null">
favoriteId,
</if>
<if test="musisMd5 != null">
musis_md5,
</if>
<if test="subTime != null">
sub_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="favoriteid != null">
#{favoriteid,jdbcType=INTEGER},
</if>
<if test="musisMd5 != null">
#{musisMd5,jdbcType=VARCHAR},
</if>
<if test="subTime != null">
#{subTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.yutou.nas.mybatis.model.MusicFavoritesExample" resultType="java.lang.Long">
select count(*) from music_favorites
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update music_favorites
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.favoriteid != null">
favoriteId = #{record.favoriteid,jdbcType=INTEGER},
</if>
<if test="record.musisMd5 != null">
musis_md5 = #{record.musisMd5,jdbcType=VARCHAR},
</if>
<if test="record.subTime != null">
sub_time = #{record.subTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update music_favorites
set id = #{record.id,jdbcType=INTEGER},
favoriteId = #{record.favoriteid,jdbcType=INTEGER},
musis_md5 = #{record.musisMd5,jdbcType=VARCHAR},
sub_time = #{record.subTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.yutou.nas.mybatis.model.MusicFavorites">
update music_favorites
<set>
<if test="favoriteid != null">
favoriteId = #{favoriteid,jdbcType=INTEGER},
</if>
<if test="musisMd5 != null">
musis_md5 = #{musisMd5,jdbcType=VARCHAR},
</if>
<if test="subTime != null">
sub_time = #{subTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yutou.nas.mybatis.model.MusicFavorites">
update music_favorites
set favoriteId = #{favoriteid,jdbcType=INTEGER},
musis_md5 = #{musisMd5,jdbcType=VARCHAR},
sub_time = #{subTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -0,0 +1,158 @@
<?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.yutou.nas.mybatis.dao.MusicFavoritesDirDao">
<resultMap id="BaseResultMap" type="com.yutou.nas.mybatis.model.MusicFavoritesDir">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, title
</sql>
<select id="selectByExample" parameterType="com.yutou.nas.mybatis.model.MusicFavoritesDirExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from music_favorites_dir
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from music_favorites_dir
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from music_favorites_dir
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.yutou.nas.mybatis.model.MusicFavoritesDirExample">
delete from music_favorites_dir
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.nas.mybatis.model.MusicFavoritesDir" useGeneratedKeys="true">
insert into music_favorites_dir (title)
values (#{title,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.nas.mybatis.model.MusicFavoritesDir" useGeneratedKeys="true">
insert into music_favorites_dir
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null">
title,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.yutou.nas.mybatis.model.MusicFavoritesDirExample" resultType="java.lang.Long">
select count(*) from music_favorites_dir
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update music_favorites_dir
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update music_favorites_dir
set id = #{record.id,jdbcType=INTEGER},
title = #{record.title,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.yutou.nas.mybatis.model.MusicFavoritesDir">
update music_favorites_dir
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yutou.nas.mybatis.model.MusicFavoritesDir">
update music_favorites_dir
set title = #{title,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>