|
@@ -27,45 +27,32 @@
|
|
|
</select>
|
|
|
|
|
|
<!--查询指定行数据-->
|
|
|
- <select id="queryAllByLimit" resultMap="SEvaluationMap">
|
|
|
+ <select id="queryAllByLimit" resultType="com.example.nngkxxdp.entity.SEvaluationDO">
|
|
|
select
|
|
|
- id, canteenId, dishesId, score, evaluation, photo_path, video_path, islike, userId, isviolations, create_time, update_time
|
|
|
- from s_evaluation
|
|
|
+ se.id, sc.canteen_name, sf.dishes_name, se.score, se.evaluation, se.photo_path, se.video_path, se.islike, se.isviolations, se.create_time, se.update_time
|
|
|
+ from s_evaluation se
|
|
|
+ left join s_canteen sc on sc.id = se.canteenId
|
|
|
+ left join s_food sf on sf.id = se.dishesId
|
|
|
<where>
|
|
|
- <if test="canteenid != null and canteenid != ''">
|
|
|
- and canteenId = #{canteenid}
|
|
|
- </if>
|
|
|
- <if test="dishesid != null and dishesid != ''">
|
|
|
- and dishesId = #{dishesid}
|
|
|
+ <if test="sEvaluation.canteenName != null and sEvaluation.canteenName != ''">
|
|
|
+ and sc.canteen_name like CONCAT('%', #{sEvaluation.canteenName}, '%')
|
|
|
</if>
|
|
|
- <if test="score != null and score != ''">
|
|
|
- and score = #{score}
|
|
|
- </if>
|
|
|
- <if test="evaluation != null and evaluation != ''">
|
|
|
- and evaluation = #{evaluation}
|
|
|
+ <if test="sEvaluation.dishesName != null and sEvaluation.dishesName != ''">
|
|
|
+ and sf.dishes_name LIKE CONCAT('%',+#{sEvaluation.dishesName}+,'%')
|
|
|
</if>
|
|
|
- <if test="photoPath != null and photoPath != ''">
|
|
|
- and photo_path = #{photoPath}
|
|
|
+ <if test="sEvaluation.score != null and sEvaluation.score != ''">
|
|
|
+ and se.score = #{sEvaluation.score}
|
|
|
</if>
|
|
|
- <if test="videoPath != null and videoPath != ''">
|
|
|
- and video_path = #{videoPath}
|
|
|
- </if>
|
|
|
- <if test="islike != null">
|
|
|
- and islike = #{islike}
|
|
|
- </if>
|
|
|
- <if test="userid != null and userid != ''">
|
|
|
- and userId = #{userid}
|
|
|
- </if>
|
|
|
- <if test="isviolations != null">
|
|
|
- and isviolations = #{isviolations}
|
|
|
+ <if test="sEvaluation.isviolations != null">
|
|
|
+ and se.isviolations = #{sEvaluation.isviolations}
|
|
|
</if>
|
|
|
- <if test="createTime != null">
|
|
|
- and create_time = #{createTime}
|
|
|
+ <if test="sEvaluation.createTime != null">
|
|
|
+ and se.create_time = #{sEvaluation.createTime}
|
|
|
</if>
|
|
|
- <if test="updateTime != null">
|
|
|
- and update_time = #{createTime}
|
|
|
+ <if test="sEvaluation.updateTime != null">
|
|
|
+ and se.update_time = #{sEvaluation.updateTime}
|
|
|
</if>
|
|
|
- and isdel = 0
|
|
|
+ and se.isdel = 0
|
|
|
</where>
|
|
|
limit #{pageable.offset}, #{pageable.pageSize}
|
|
|
</select>
|
|
@@ -73,42 +60,29 @@
|
|
|
<!--统计总行数-->
|
|
|
<select id="count" resultType="java.lang.Long">
|
|
|
select count(1)
|
|
|
- from s_evaluation
|
|
|
+ from s_evaluation se
|
|
|
+ left join s_canteen sc on sc.id = se.canteenId
|
|
|
+ left join s_food sf on sf.id = se.dishesId
|
|
|
<where>
|
|
|
- <if test="canteenid != null and canteenid != ''">
|
|
|
- and canteenId = #{canteenid}
|
|
|
+ <if test="canteenName != null and canteenName != ''">
|
|
|
+ and sc.canteen_name like CONCAT('%', #{canteenName}, '%')
|
|
|
</if>
|
|
|
- <if test="dishesid != null and dishesid != ''">
|
|
|
- and dishesId = #{dishesid}
|
|
|
+ <if test="dishesName != null and dishesName != ''">
|
|
|
+ and sf.dishes_name LIKE CONCAT('%',+#{dishesName}+,'%')
|
|
|
</if>
|
|
|
<if test="score != null and score != ''">
|
|
|
- and score = #{score}
|
|
|
- </if>
|
|
|
- <if test="evaluation != null and evaluation != ''">
|
|
|
- and evaluation = #{evaluation}
|
|
|
- </if>
|
|
|
- <if test="photoPath != null and photoPath != ''">
|
|
|
- and photo_path = #{photoPath}
|
|
|
- </if>
|
|
|
- <if test="videoPath != null and videoPath != ''">
|
|
|
- and video_path = #{videoPath}
|
|
|
- </if>
|
|
|
- <if test="islike != null">
|
|
|
- and islike = #{islike}
|
|
|
- </if>
|
|
|
- <if test="userid != null and userid != ''">
|
|
|
- and userId = #{userid}
|
|
|
+ and se.score = #{score}
|
|
|
</if>
|
|
|
<if test="isviolations != null">
|
|
|
- and isviolations = #{isviolations}
|
|
|
+ and se.isviolations = #{isviolations}
|
|
|
</if>
|
|
|
<if test="createTime != null">
|
|
|
- and create_time = #{createTime}
|
|
|
+ and se.create_time = #{createTime}
|
|
|
</if>
|
|
|
<if test="updateTime != null">
|
|
|
- and update_time = #{createTime}
|
|
|
+ and se.update_time = #{updateTime}
|
|
|
</if>
|
|
|
- and isdel = 0
|
|
|
+ and se.isdel = 0
|
|
|
</where>
|
|
|
</select>
|
|
|
|