|
@@ -8,14 +8,17 @@
|
|
</insert>
|
|
</insert>
|
|
<!-- 新增游记内容 -->
|
|
<!-- 新增游记内容 -->
|
|
<insert id="travelInster" parameterType="Travel">
|
|
<insert id="travelInster" parameterType="Travel">
|
|
- insert into bus_travel(code,title_img,synopsis,video_url,img_url,uuid,state_type,travel_date,travel_day,capita,figure,play_type,season,destination,jdrq,title,title_travel,demand_uuid)
|
|
|
|
- values (#{code},#{titleImg},#{synopsis},#{videoUrl},#{imgUrl},#{uuid},#{stateType},#{travelDate},#{travelDay},#{capita},#{figure},#{playType},#{season},#{destination},GETDATE(),#{title},#{titleTravel},#{demandUuid})
|
|
|
|
|
|
+ insert into bus_travel(code,title_img,synopsis,video_url,img_url,uuid,state_type,travel_date,travel_day,capita,figure,play_type,season,destination,jdrq,title,title_travel,demand_uuid,look_num)
|
|
|
|
+ values (#{code},#{titleImg},#{synopsis},#{videoUrl},#{imgUrl},#{uuid},#{stateType},#{travelDate},#{travelDay},#{capita},#{figure},#{playType},#{season},#{destination},GETDATE(),#{title},#{titleTravel},#{demandUuid},0)
|
|
</insert>
|
|
</insert>
|
|
<!-- 查询游记内容 -->
|
|
<!-- 查询游记内容 -->
|
|
<select id="getTravel" resultType="Travel">
|
|
<select id="getTravel" resultType="Travel">
|
|
select
|
|
select
|
|
- id,code,title_img as titleImg,synopsis,video_url as videoUrl,img_url as imgUrl,uuid,state_type as stateType,travel_date as travelDate,travel_day as travelDay,capita,figure,play_type as playType,season,destination,jdrq,title,title_travel as titleTravel
|
|
|
|
- from bus_travel
|
|
|
|
|
|
+ a.*,b.countNum,c.flag,d.commCount
|
|
|
|
+ from bus_travel a
|
|
|
|
+ JOIN ( SELECT COUNT ( * ) AS countNum, travel_uuid FROM sys_travel_give GROUP BY travel_uuid ) b ON a.uuid = b.travel_uuid
|
|
|
|
+ JOIN ( SELECT COUNT ( * ) AS flag, travel_uuid FROM sys_travel_give WHERE code = #{code} GROUP BY travel_uuid ) c ON a.uuid = c.travel_uuid
|
|
|
|
+ JOIN ( SELECT COUNT ( * ) AS commCount, travel_uuid FROM bus_travel_comments GROUP BY travel_uuid ) d ON a.uuid = d.travel_uuid
|
|
<trim prefix="WHERE" prefixOverrides="and | or">
|
|
<trim prefix="WHERE" prefixOverrides="and | or">
|
|
<if test="uuid != null and uuid != ''">
|
|
<if test="uuid != null and uuid != ''">
|
|
and uuid = #{uuid}
|
|
and uuid = #{uuid}
|
|
@@ -31,6 +34,26 @@
|
|
</if>
|
|
</if>
|
|
</trim>
|
|
</trim>
|
|
</select>
|
|
</select>
|
|
|
|
+ <!-- 查询游记列表内容 -->
|
|
|
|
+ <select id="getTravelAll" resultType="Travel">
|
|
|
|
+ select
|
|
|
|
+ a.*,b.countNum,c.flag,d.commCount
|
|
|
|
+ from bus_travel a
|
|
|
|
+ JOIN ( SELECT COUNT ( * ) AS countNum, travel_uuid FROM sys_travel_give GROUP BY travel_uuid ) b ON a.uuid = b.travel_uuid
|
|
|
|
+ JOIN ( SELECT COUNT ( * ) AS flag, travel_uuid FROM sys_travel_give WHERE code = #{code} GROUP BY travel_uuid ) c ON a.uuid = c.travel_uuid
|
|
|
|
+ JOIN ( SELECT COUNT ( * ) AS commCount, travel_uuid FROM bus_travel_comments GROUP BY travel_uuid ) d ON a.uuid = d.travel_uuid
|
|
|
|
+ <trim prefix="WHERE" prefixOverrides="and | or">
|
|
|
|
+ <if test="uuid != null and uuid != ''">
|
|
|
|
+ and uuid = #{uuid}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="stateType != null and stateType != ''">
|
|
|
|
+ and state_type = #{stateType}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="demandUuid != null and demandUuid != ''">
|
|
|
|
+ and demand_uuid = #{demandUuid}
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ </select>
|
|
<!-- 查询每天游记内容 -->
|
|
<!-- 查询每天游记内容 -->
|
|
<select id="getTravelExper" resultType="TravelExperience">
|
|
<select id="getTravelExper" resultType="TravelExperience">
|
|
select id,uuid,day_num as dayNum,synopsis,video_url as videoUrl,img_url as imgUrl,title
|
|
select id,uuid,day_num as dayNum,synopsis,video_url as videoUrl,img_url as imgUrl,title
|
|
@@ -106,4 +129,8 @@
|
|
<delete id="delGive" parameterType="TravelGive">
|
|
<delete id="delGive" parameterType="TravelGive">
|
|
delete from sys_travel_give where code = #{code} and travel_uuid=#{travelUuid}
|
|
delete from sys_travel_give where code = #{code} and travel_uuid=#{travelUuid}
|
|
</delete>
|
|
</delete>
|
|
|
|
+ <!-- 查看数量 -->
|
|
|
|
+ <update id="updateLookNum" parameterType="Travel">
|
|
|
|
+ update bus_travel set
|
|
|
|
+ </update>
|
|
</mapper>
|
|
</mapper>
|