|
@@ -3,24 +3,26 @@
|
|
|
<mapper namespace="cn.efunbox.dao.RecommendMapper">
|
|
|
<!-- 新增 -->
|
|
|
<insert id="insert">
|
|
|
- insert into film_recmd(type,age,sex,film_code,score,created)
|
|
|
- values(#{type},#{age},#{sex},#{film_code},#{score},#{created})
|
|
|
+ insert into film_recmd(type,age,sex,film_code,age_group,movie_tag,score,created)
|
|
|
+ values(#{type},#{age},#{sex},#{film_code},#{age_group},#{movie_tag},#{score},#{created})
|
|
|
</insert>
|
|
|
|
|
|
<!-- 查询所有结果 -->
|
|
|
- <select id="queryAll" resultType="Recommend" >
|
|
|
+ <select id="queryAll" resultType="cn.efunbox.model.Recommend" >
|
|
|
select * from film_recmd
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<!-- 搜索 -->
|
|
|
<select id="search" resultType="Map" >
|
|
|
- select id,age,sex,type,film_code,times,score from film_recmd
|
|
|
+ select id,age,sex,type,film_code,age_group,movie_tag,times,score from film_recmd
|
|
|
where age=#{age} and sex=#{sex} and type=#{type}
|
|
|
- order by score desc limit #{limit} offset #{offset}
|
|
|
+ <if test="null!=age_group and ''!=age_group and 0!=age_group"> and age_group <= #{age_group }</if>
|
|
|
+ <if test="null!=movie_tag and ''!=movie_tag "> and movie_tag like concat(concat('%',#{movie_tag}),'%')</if>
|
|
|
+ order by score desc limit #{limit} offset #{offset}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<!-- 搜索 -->
|
|
|
- <select id="get" resultType="Recommend" >
|
|
|
+ <select id="get" resultType="cn.efunbox.model.Recommend" >
|
|
|
select * from film_recmd
|
|
|
where age=#{age} and sex=#{sex} and type=#{type} and film_code=#{film_code} limit 1
|
|
|
</select>
|
|
@@ -29,10 +31,8 @@
|
|
|
<update id="delete">
|
|
|
delete from film_recmd where
|
|
|
type=#{type} and film_code=#{film_code}
|
|
|
- <set>
|
|
|
- <if test="null!=age and ''!=age and 0!=age"> and age = #{age }</if>
|
|
|
- <if test="null!=sex and ''!=sex and 0!=sex"> and sex = #{sex }</if>
|
|
|
- </set>
|
|
|
+ <if test="null!=age and ''!=age and 0!=age"> and age = #{age }</if>
|
|
|
+ <if test="null!=sex and ''!=sex and 0!=sex"> and sex = #{sex }</if>
|
|
|
</update>
|
|
|
|
|
|
<!-- 更新一条记录的排序积分 -->
|