30 lines
914 B
XML
30 lines
914 B
XML
|
|
<?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._3e.dubdao.DubSupportDao">
|
||
|
|
<select id="findLikeCountById" parameterType="long" resultType="int">
|
||
|
|
SELECT SUM(islike)
|
||
|
|
FROM dubsupport WHERE voiceid = #{voiceid}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="findSupportById" parameterType="map" resultType="com.dub.entity.DubSupport">
|
||
|
|
SELECT voiceid,uid,islike
|
||
|
|
FROM DubSupport
|
||
|
|
WHERE voiceid = #{voiceid} AND uid = #{uid}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<update id="doUpdateSupport" parameterType="com.dub.entity.DubSupport">
|
||
|
|
Update DubSupport
|
||
|
|
<set>
|
||
|
|
<if test="islike != null">islike = #{islike}</if>
|
||
|
|
</set>
|
||
|
|
WHERE voiceid = #{voiceid} AND uid = #{uid}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<insert id="doSaveSupport" parameterType="com.dub.entity.DubSupport">
|
||
|
|
INSERT INTO DubSupport(voiceid,uid,islike)
|
||
|
|
VALUES (#{voiceid},#{uid},#{islike})
|
||
|
|
</insert>
|
||
|
|
</mapper>
|