|
@@ -15,6 +15,7 @@
|
|
|
<result column="cover_url_" property="coverUrl" />
|
|
|
<result column="cover_thumbnail_url_" property="coverThumbnailUrl" />
|
|
|
<result column="order_" property="order" />
|
|
|
+ <result column="time_line_" property="timeLine" />
|
|
|
<result column="create_time_" property="createTime" />
|
|
|
<result column="update_time_" property="updateTime" />
|
|
|
</resultMap>
|
|
@@ -31,40 +32,47 @@
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.PhotoAlbum" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO photo_album_ (music_group_id_,name_,client_show_,type_,cover_url_,cover_thumbnail_url_,create_time_,update_time_,order_)
|
|
|
- VALUES(#{musicGroupId},#{name},#{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{type},#{coverUrl},#{coverThumbnailUrl},NOW(),NOW(),#{order})
|
|
|
+ INSERT INTO photo_album_ (music_group_id_,name_,client_show_,type_,cover_url_,cover_thumbnail_url_,create_time_,update_time_,order_,time_line_)
|
|
|
+ VALUES(#{musicGroupId},#{name},#{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{type},#{coverUrl},#{coverThumbnailUrl},NOW(),NOW(),#{order},#{timeLine})
|
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.PhotoAlbum">
|
|
|
UPDATE photo_album_ <set>
|
|
|
+ <if test="timeLine != null">
|
|
|
+ time_line_ = #{timeLine},
|
|
|
+ </if>
|
|
|
<if test="coverUrl != null">
|
|
|
- cover_url_ = #{coverUrl},
|
|
|
+ cover_url_ = #{coverUrl},
|
|
|
</if>
|
|
|
<if test="order != null">
|
|
|
order_ = #{order},
|
|
|
</if>
|
|
|
<if test="coverThumbnailUrl != null">
|
|
|
- cover_thumbnail_url_ = #{coverThumbnailUrl},
|
|
|
+ cover_thumbnail_url_ = #{coverThumbnailUrl},
|
|
|
</if>
|
|
|
<if test="clientShow != null">
|
|
|
- client_show_ = #{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ client_show_ = #{clientShow,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
|
<if test="musicGroupId != null">
|
|
|
- music_group_id_ = #{musicGroupId},
|
|
|
+ music_group_id_ = #{musicGroupId},
|
|
|
</if>
|
|
|
<if test="type != null">
|
|
|
- type_ = #{type},
|
|
|
+ type_ = #{type},
|
|
|
</if>
|
|
|
<if test="name != null">
|
|
|
- name_ = #{name},
|
|
|
+ name_ = #{name},
|
|
|
</if>
|
|
|
- update_time_ = NOW()
|
|
|
+ update_time_ = NOW()
|
|
|
</set> WHERE id_ = #{id}
|
|
|
</update>
|
|
|
<update id="batchUpdate">
|
|
|
<foreach collection="photoAlbumList" item="album" separator=";">
|
|
|
UPDATE photo_album_ <set>
|
|
|
+ <if test="album.timeLine != null">
|
|
|
+ time_line_ = #{album.timeLine},
|
|
|
+ </if>
|
|
|
<if test="album.coverUrl != null">
|
|
|
cover_url_ = #{album.coverUrl},
|
|
|
</if>
|