<?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.yonge.cooleshow.biz.dal.dao.MusicFavoriteDao">

	<resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.MusicFavorite">
	     <id column="id_" jdbcType="BIGINT" property="id" />
		 <result column="user_id_" jdbcType="BIGINT" property="userId" />
		 <result column="music_sheet_id_" jdbcType="BIGINT" property="musicSheetId" />
		 <result column="favorite_time_" jdbcType="TIMESTAMP" property="favoriteTime" />
		 <result column="favorite_flag_" jdbcType="TINYINT" property="favoriteFlag" />
	</resultMap>

	<sql id="Base_Column_List">
		id_, user_id_, music_sheet_id_, favorite_time_, favorite_flag_
	</sql>

	<select id="selectMusicSheetFavoriteNum" resultType="long">
		select count(1)
		from music_favorite
		where music_sheet_id_ = #{musicSheetId}
    </select>
</mapper>