Skip to content

Commit

Permalink
6.10 沉住气 认真修订
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzzzzzzyt committed Jun 10, 2022
1 parent 67f5777 commit ab4eede
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 179 deletions.
28 changes: 0 additions & 28 deletions music-server/src/main/java/com/example/yin/mapper/SongMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,7 @@
import com.example.yin.model.domain.Song;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SongMapper extends BaseMapper<Song> {

int insert(Song record);

int insertSelective(Song record);

Song selectByPrimaryKey(Integer id);


int updateByPrimaryKeyWithBLOBs(Song record);

int updateByPrimaryKey(Song record);

int updateSongMsg(Song record);

int updateSongUrl(Song record);

int updateSongPic(Song record);

int deleteSong(Integer id);

List<Song> allSong();

List<Song> songOfSingerId(Integer singerId);

List<Song> songOfId(Integer id);

List<Song> songOfSingerName(String name);
}
152 changes: 1 addition & 151 deletions music-server/src/main/resources/mapper/SongMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,155 +20,5 @@
<sql id="Blob_Column_List">
lyric
</sql>
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer">
select
from song
where id = #{id,jdbcType=INTEGER}
</select>
<select id="allSong" resultMap="ResultMapWithBLOBs">
select *
from song
</select>
<select id="songOfSingerId" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select *
from song
where singer_id = #{singerId, jdbcType=INTEGER}
</select>
<select id="songOfId" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select *
from song
where id = #{id, jdbcType=INTEGER}
</select>
<select id="songOfSingerName" resultMap="BaseResultMap" parameterType="java.lang.String">
select *
from song
where name like #{name, jdbcType=VARCHAR}
</select>
<delete id="deleteSong" parameterType="java.lang.Integer">
delete from song
where id = #{id, jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.example.yin.model.domain.Song">
insert into song (id, singer_id, name, introduction, create_time, update_time, pic, lyric)
values (#{id,jdbcType=INTEGER}, #{singerId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{introduction,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{pic,jdbcType=VARCHAR}, #{lyric,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.example.yin.model.domain.Song">
insert into song
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="singerId != null">
singer_id,
</if>
<if test="name != null">
name,
</if>
<if test="introduction != null">
introduction,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="pic != null">
pic,
</if>
<if test="lyric != null">
lyric,
</if>
<if test="url != null">
url,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> #{id,jdbcType=INTEGER},
</if>
<if test="singerId != null"> #{singerId,jdbcType=INTEGER},
</if>
<if test="name != null"> #{name,jdbcType=VARCHAR},
</if>
<if test="introduction != null"> #{introduction,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null"> #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="pic != null"> #{pic,jdbcType=VARCHAR},
</if>
<if test="lyric != null"> #{lyric,jdbcType=LONGVARCHAR},
</if>
<if test="url != null"> #{url,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateSongMsg" parameterType="com.example.yin.model.domain.Song">
update song
<set >
<if test="singerId != null">
singer_id = #{singerId,jdbcType=INTEGER},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="introduction != null">
introduction = #{introduction,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="pic != null">
pic = #{pic,jdbcType=VARCHAR},
</if>
<if test="lyric != null">
lyric = #{lyric,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateSongUrl" parameterType="com.example.yin.model.domain.Consumer">
update song
<set >
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateSongPic" parameterType="com.example.yin.model.domain.Consumer">
update song
<set >
<if test="pic != null">
pic = #{pic,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.example.yin.model.domain.Song">
update song
set singer_id = #{singerId,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
introduction = #{introduction,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
pic = #{pic,jdbcType=VARCHAR},
url = #{url,jdbcType=VARCHAR},
lyric = #{lyric,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.example.yin.model.domain.Song">
update song
set singer_id = #{singerId,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
introduction = #{introduction,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
pic = #{pic,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>

</mapper>

0 comments on commit ab4eede

Please sign in to comment.