|
@@ -96,107 +96,101 @@
|
|
<select id="findAllScene" parameterType="com.fdkankan.scene.vo.SceneParamVO"
|
|
<select id="findAllScene" parameterType="com.fdkankan.scene.vo.SceneParamVO"
|
|
resultType="com.fdkankan.scene.entity.SceneProPO">
|
|
resultType="com.fdkankan.scene.entity.SceneProPO">
|
|
select a.* from (
|
|
select a.* from (
|
|
- SELECT t.id,scene_name, scene_dec, web_site, thumb, scene_type,
|
|
|
|
- t.create_time, scene_status, user_id, pay_status, camera_id, scene_code, scene_scheme, shoot_count,
|
|
|
|
- rec_status, SPACE, recommend, view_count, 'V1' AS build_type
|
|
|
|
- FROM `t_scene` t
|
|
|
|
- LEFT JOIN t_scene_ext ext ON t.id = ext.scene_id
|
|
|
|
- UNION
|
|
|
|
- SELECT t.id,t.scene_name, t.scene_dec, t.web_site, t.thumb, t.scene_type,
|
|
|
|
- t.create_time, ext.scene_status, t.user_id, ext.pay_status, t.camera_id, t.scene_code, t.scene_scheme, t.shoot_count,
|
|
|
|
- t.rec_status, ext.space, ext.recommend, t.view_count, t.build_type
|
|
|
|
- FROM `t_scene_pro` t
|
|
|
|
- LEFT JOIN t_scene_pro_ext ext ON t.id = ext.scene_pro_id
|
|
|
|
|
|
+ SELECT t.id,scene_name, scene_dec, web_site, thumb, scene_type,
|
|
|
|
+ t.create_time, scene_status, user_id, pay_status, camera_id, scene_code, scene_scheme, shoot_count,
|
|
|
|
+ rec_status, SPACE, recommend, view_count, 'V1' AS build_type
|
|
|
|
+ FROM `t_scene` t
|
|
|
|
+ LEFT JOIN t_scene_ext ext ON t.id = ext.scene_id
|
|
|
|
+ UNION
|
|
|
|
+ SELECT t.id,t.scene_name, t.scene_dec, t.web_site, t.thumb, t.scene_type,
|
|
|
|
+ t.create_time, t.scene_status, t.user_id, t.pay_status, t.camera_id, t.scene_code, t.scene_scheme, ext.shoot_count,
|
|
|
|
+ t.rec_status, ext.space, ext.recommend, ext.view_count, t.build_type
|
|
|
|
+ FROM `t_scene_pro` t
|
|
|
|
+ LEFT JOIN t_scene_pro_ext ext ON t.id = ext.scene_pro_id
|
|
) a
|
|
) a
|
|
where 1 = 1 and rec_status = 'A' and a.scene_type != 99
|
|
where 1 = 1 and rec_status = 'A' and a.scene_type != 99
|
|
- <if test="sceneType != null and sceneType!= ''">
|
|
|
|
- and a.scene_type = #{sceneType}
|
|
|
|
|
|
+ <if test="param.sceneType != null and param.sceneType!= ''">
|
|
|
|
+ and a.scene_type = #{param.sceneType}
|
|
</if>
|
|
</if>
|
|
- <if test="sceneScheme != null">
|
|
|
|
|
|
+ <if test="param.sceneScheme != null">
|
|
<choose>
|
|
<choose>
|
|
- <when test="sceneScheme >= 4">
|
|
|
|
- and a.scene_scheme >= #{sceneScheme}
|
|
|
|
|
|
+ <when test="param.sceneScheme >= 4">
|
|
|
|
+ and a.scene_scheme >= #{param.sceneScheme}
|
|
</when>
|
|
</when>
|
|
<otherwise>
|
|
<otherwise>
|
|
- and a.scene_scheme <![CDATA[ < ]]> #{sceneScheme}
|
|
|
|
|
|
+ and a.scene_scheme <![CDATA[ < ]]> #{param.sceneScheme}
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
</if>
|
|
</if>
|
|
- <if test="type != null and type == '11'">
|
|
|
|
|
|
+ <if test="param.type != null and param.type == '11'">
|
|
and a.scene_status in (1, -2)
|
|
and a.scene_status in (1, -2)
|
|
and a.pay_status = 1
|
|
and a.pay_status = 1
|
|
and a.build_type = 'V3'
|
|
and a.build_type = 'V3'
|
|
</if>
|
|
</if>
|
|
- <if test="userId != null">
|
|
|
|
- and a.user_id = #{userId}
|
|
|
|
|
|
+ <if test="param.userId != null">
|
|
|
|
+ and a.user_id = #{param.userId}
|
|
</if>
|
|
</if>
|
|
- <if test="userId == null">
|
|
|
|
|
|
+ <if test="param.userId == null">
|
|
and a.scene_status = 1
|
|
and a.scene_status = 1
|
|
and a.pay_status = 1
|
|
and a.pay_status = 1
|
|
</if>
|
|
</if>
|
|
<choose>
|
|
<choose>
|
|
- <when test="nums != null and nums.size() > 0">
|
|
|
|
|
|
+ <when test="param.nums != null and param.nums.length > 0">
|
|
<choose>
|
|
<choose>
|
|
- <when test="sceneName != null and sceneName != '' and cameraId != null">
|
|
|
|
- and (a.scene_name like CONCAT('%',#{sceneName},'%')
|
|
|
|
- or a.scene_code like #{likeNum}
|
|
|
|
- or a.camera_id = #{cameraId}
|
|
|
|
|
|
+ <when test="param.sceneName != null and param.sceneName != '' and param.cameraIds != null">
|
|
|
|
+ and (a.scene_name like CONCAT('%',#{param.sceneName},'%')
|
|
|
|
+ or a.scene_code like #{param.likeNum}
|
|
|
|
+ or a.camera_id in (#{param.cameraId})
|
|
or a.scene_code in
|
|
or a.scene_code in
|
|
- <foreach collection="numList" item="item" open="(" close=")" separator=",">
|
|
|
|
|
|
+ <foreach collection="param.nums" item="item" open="(" close=")" separator=",">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
)
|
|
)
|
|
</when>
|
|
</when>
|
|
- <when test="sceneName != null and sceneName !=''">
|
|
|
|
- and (a.scene_name like CONCAT('%',#{sceneName},'%')
|
|
|
|
- or a.scene_code like #{likeNum}
|
|
|
|
- or a.scene_code in
|
|
|
|
- <foreach collection="numList" item="item" open="(" close=")" separator=",">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
|
|
+ <when test="param.sceneName != null and param.sceneName !=''">
|
|
|
|
+ and (a.scene_name like CONCAT('%',#{param.sceneName},'%')
|
|
|
|
+ or a.scene_code like #{param.likeNum}
|
|
|
|
+ or a.scene_code in (#{param.nums})
|
|
)
|
|
)
|
|
</when>
|
|
</when>
|
|
<otherwise>
|
|
<otherwise>
|
|
- and (a.camera_id = #{cameraId}
|
|
|
|
- or a.scene_code in
|
|
|
|
- <foreach collection="numList" item="item" open="(" close=")" separator=",">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
|
|
+ and (a.camera_id = #{param.cameraId}
|
|
|
|
+ or a.scene_code in (#{param.nums})
|
|
)
|
|
)
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
</when>
|
|
</when>
|
|
<otherwise>
|
|
<otherwise>
|
|
<choose>
|
|
<choose>
|
|
- <when test="sceneName != null and sceneName != '' and cameraId != null">
|
|
|
|
- and (a.scene_name like CONCAT('%',#{sceneName},'%')
|
|
|
|
- or a.scene_code like #{likeNum}
|
|
|
|
- or a.camera_id = #{cameraId}
|
|
|
|
- or a.scene_code in
|
|
|
|
|
|
+ <when test="param.sceneName != null and param.sceneName != '' and param.cameraId != null">
|
|
|
|
+ and (a.scene_name like CONCAT('%',#{param.sceneName},'%')
|
|
|
|
+ or a.scene_code like #{param.likeNum}
|
|
|
|
+ or a.camera_id in #{param.cameraId}
|
|
|
|
+ or a.scene_code in (#{param.nums})
|
|
)
|
|
)
|
|
</when>
|
|
</when>
|
|
- <when test="sceneName != null and sceneName !=''">
|
|
|
|
- and (a.scene_name like CONCAT('%',#{sceneName},'%')
|
|
|
|
- or a.scene_code like #{likeNum}
|
|
|
|
|
|
+ <when test="param.sceneName != null and param.sceneName !=''">
|
|
|
|
+ and (a.scene_name like CONCAT('%',#{param.sceneName},'%')
|
|
|
|
+ or a.scene_code like #{param.likeNum}
|
|
)
|
|
)
|
|
</when>
|
|
</when>
|
|
<otherwise>
|
|
<otherwise>
|
|
- and a.camera_id = #{cameraId}
|
|
|
|
|
|
+ and a.camera_id in ( #{param.cameraId} )
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
- <if test="startTime != null">
|
|
|
|
- and a.create_time >= #{startTime}
|
|
|
|
|
|
+ <if test="param.startTime != null">
|
|
|
|
+ and a.create_time >= #{param.startTime}
|
|
</if>
|
|
</if>
|
|
- <if test="endTime != null">
|
|
|
|
- and a.create_time <![CDATA[ <= ]]> #{endDate}
|
|
|
|
|
|
+ <if test="param.endTime != null">
|
|
|
|
+ and a.create_time <![CDATA[ <= ]]> #{param.endDate}
|
|
</if>
|
|
</if>
|
|
- <if test="num != null and num != ''">
|
|
|
|
- and a.scene_code = #{num}
|
|
|
|
|
|
+ <if test="param.num != null and param.num != ''">
|
|
|
|
+ and a.scene_code = #{param.num}
|
|
</if>
|
|
</if>
|
|
- <if test="order != null and order != ''">
|
|
|
|
- order by ${order}
|
|
|
|
|
|
+ <if test="param.order != null and param.order != ''">
|
|
|
|
+ order by ${param.order}
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
|
|
|