|
@@ -4,82 +4,91 @@
|
|
|
<mapper namespace="cn.reghao.tnb.content.app.geo.db.mapper.CameraPhotoMapper">
|
|
<mapper namespace="cn.reghao.tnb.content.app.geo.db.mapper.CameraPhotoMapper">
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into geo_camera_photo
|
|
insert into geo_camera_photo
|
|
|
- (`album_type`,`album_id`,`object_id`,`channel_code`,`photo_url`,`manufacturer`,`model`,`software`,`shot_at`,`geo`)
|
|
|
|
|
|
|
+ (`album_type`,`album_id`,`object_id`,`channel_code`,`photo_url`,`manufacturer`,`model`,`software`,`shot_at`,`geo`,`geo_valid`)
|
|
|
values
|
|
values
|
|
|
- (#{albumType},#{albumId},#{objectId},#{channelCode},#{photoUrl},#{manufacturer},#{model},#{software},#{shotAt},point(#{longitude},#{latitude}))
|
|
|
|
|
|
|
+ (#{albumType},#{albumId},#{objectId},#{channelCode},#{photoUrl},#{manufacturer},#{model},#{software},#{shotAt},point(#{longitude},#{latitude}),#{geoValid})
|
|
|
</insert>
|
|
</insert>
|
|
|
<insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert ignore into geo_camera_photo
|
|
insert ignore into geo_camera_photo
|
|
|
- (`album_type`,`album_id`,`object_id`,`channel_code`,`photo_url`,`manufacturer`,`model`,`software`,`shot_at`,`geo`)
|
|
|
|
|
|
|
+ (`album_type`,`album_id`,`object_id`,`channel_code`,`photo_url`,`manufacturer`,`model`,`software`,`shot_at`,`geo`,`geo_valid`)
|
|
|
values
|
|
values
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
|
- (#{item.albumType},#{item.albumId},#{item.objectId},#{item.channelCode},#{item.photoUrl},#{item.manufacturer},#{item.model},#{item.software},#{item.shotAt},point(#{item.longitude},#{item.latitude}))
|
|
|
|
|
|
|
+ (#{item.albumType},#{item.albumId},#{item.objectId},#{item.channelCode},#{item.photoUrl},#{item.manufacturer},#{item.model},#{item.software},#{item.shotAt},point(#{item.longitude},#{item.latitude}),#{item.geoValid})
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
- <update id="updateSetAlbumId">
|
|
|
|
|
- update geo_camera_photo
|
|
|
|
|
- set album_id=#{albumId}
|
|
|
|
|
- where object_id=#{objectId}
|
|
|
|
|
- </update>
|
|
|
|
|
<update id="updateSetAlbumType">
|
|
<update id="updateSetAlbumType">
|
|
|
update geo_camera_photo
|
|
update geo_camera_photo
|
|
|
set album_type=#{albumType}
|
|
set album_type=#{albumType}
|
|
|
where object_id=#{objectId}
|
|
where object_id=#{objectId}
|
|
|
</update>
|
|
</update>
|
|
|
|
|
|
|
|
- <delete id="delete">
|
|
|
|
|
|
|
+ <delete id="deleteById">
|
|
|
delete from geo_camera_photo
|
|
delete from geo_camera_photo
|
|
|
where id=#{id}
|
|
where id=#{id}
|
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
|
|
- <select id="findById" resultType="cn.reghao.tnb.content.app.geo.model.po.CameraPhoto">
|
|
|
|
|
- select *
|
|
|
|
|
- from geo_camera_photo
|
|
|
|
|
- where id=#{id}
|
|
|
|
|
- </select>
|
|
|
|
|
- <select id="findAll" resultType="cn.reghao.tnb.content.app.geo.model.po.CameraPhoto">
|
|
|
|
|
- select *
|
|
|
|
|
- from geo_camera_photo
|
|
|
|
|
- </select>
|
|
|
|
|
-
|
|
|
|
|
<resultMap id="mapMarker" type="cn.reghao.tnb.content.app.geo.model.vo.MapMarker">
|
|
<resultMap id="mapMarker" type="cn.reghao.tnb.content.app.geo.model.vo.MapMarker">
|
|
|
<result property="id" column="id"/>
|
|
<result property="id" column="id"/>
|
|
|
- <result property="title" column="cup"/>
|
|
|
|
|
|
|
+ <result property="title" column="title"/>
|
|
|
<association property="position" javaType="cn.reghao.tnb.content.app.geo.model.vo.MapPoint">
|
|
<association property="position" javaType="cn.reghao.tnb.content.app.geo.model.vo.MapPoint">
|
|
|
<result property="lng" column="lng"/>
|
|
<result property="lng" column="lng"/>
|
|
|
<result property="lat" column="lat"/>
|
|
<result property="lat" column="lat"/>
|
|
|
</association>
|
|
</association>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
- <select id="findByWestGeoGroup" resultMap="mapMarker">
|
|
|
|
|
- select id, manufacturer as cup,x(geo) as lng,y(geo) as lat
|
|
|
|
|
- from geo_camera_photo
|
|
|
|
|
- where `type`=#{itemType} and geo is not null
|
|
|
|
|
- group by geo
|
|
|
|
|
- order by shot_at desc
|
|
|
|
|
|
|
+ <select id="findAlbumIdGroup" resultMap="mapMarker">
|
|
|
|
|
+ select photo.id,photo.manufacturer as title,photo.photo_url,x(photo.geo) as lng,y(photo.geo) as lat
|
|
|
|
|
+ from geo_camera_photo photo
|
|
|
|
|
+ inner join geo_mall_reply reply
|
|
|
|
|
+ on photo.album_id=reply.reply_id and photo.geo_valid=1
|
|
|
|
|
+ group by photo.album_id
|
|
|
|
|
+ order by photo.id desc
|
|
|
limit #{pageSize}
|
|
limit #{pageSize}
|
|
|
</select>
|
|
</select>
|
|
|
- <select id="findAllByReplyIdGroup" resultMap="mapMarker">
|
|
|
|
|
- select photo.id,photo.manufacturer as cup,photo.photo_url,x(photo.geo) as lng,y(photo.geo) as lat
|
|
|
|
|
|
|
+ <select id="findByImagePost" resultMap="mapMarker">
|
|
|
|
|
+ select photo.id,photo.manufacturer as title,photo.photo_url,x(photo.geo) as lng,y(photo.geo) as lat
|
|
|
|
|
+ from geo_camera_photo photo
|
|
|
|
|
+ where photo.album_type='ImagePost' and photo.geo_valid=1
|
|
|
|
|
+ group by photo.album_id
|
|
|
|
|
+ order by photo.id desc
|
|
|
|
|
+ limit #{pageSize}
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="findByMallReply" resultMap="mapMarker">
|
|
|
|
|
+ select photo.id,photo.manufacturer as title,photo.photo_url,x(photo.geo) as lng,y(photo.geo) as lat
|
|
|
from geo_camera_photo photo
|
|
from geo_camera_photo photo
|
|
|
inner join geo_mall_reply reply
|
|
inner join geo_mall_reply reply
|
|
|
- on photo.album_id=reply.reply_id and photo.geo is not null
|
|
|
|
|
|
|
+ on photo.album_id=reply.reply_id and photo.geo_valid=1 and photo.album_type='MallReply'
|
|
|
group by photo.album_id
|
|
group by photo.album_id
|
|
|
order by photo.id desc
|
|
order by photo.id desc
|
|
|
limit #{pageSize}
|
|
limit #{pageSize}
|
|
|
</select>
|
|
</select>
|
|
|
- <!-- 由西向东升序 -->
|
|
|
|
|
- <select id="findByWestChina" resultMap="mapMarker">
|
|
|
|
|
- select photo.id,reply.cup,photo.photo_url,x(photo.geo) as lng,y(photo.geo) as lat
|
|
|
|
|
|
|
+ <select id="findByMallReplyCup" resultMap="mapMarker">
|
|
|
|
|
+ select photo.id,reply.cup as title,photo.photo_url,x(photo.geo) as lng,y(photo.geo) as lat
|
|
|
from geo_camera_photo photo
|
|
from geo_camera_photo photo
|
|
|
inner join geo_mall_reply reply
|
|
inner join geo_mall_reply reply
|
|
|
- on photo.album_id=reply.reply_id and photo.geo is not null
|
|
|
|
|
|
|
+ on photo.album_id=reply.reply_id and photo.geo_valid=1 and photo.album_type='MallReply'
|
|
|
and reply.item_type=#{itemType}
|
|
and reply.item_type=#{itemType}
|
|
|
group by photo.album_id
|
|
group by photo.album_id
|
|
|
order by photo.id desc
|
|
order by photo.id desc
|
|
|
limit #{pageSize}
|
|
limit #{pageSize}
|
|
|
</select>
|
|
</select>
|
|
|
- <select id="findCommentMarkerInfo" resultType="cn.reghao.tnb.content.app.geo.model.vo.MarkerInfo">
|
|
|
|
|
|
|
+ <select id="findByMallReplyItem" resultMap="mapMarker">
|
|
|
|
|
+ select photo.id,photo.manufacturer as title,photo.photo_url,x(photo.geo) as lng,y(photo.geo) as lat
|
|
|
|
|
+ from geo_camera_photo photo
|
|
|
|
|
+ inner join geo_mall_reply reply
|
|
|
|
|
+ on photo.album_id=reply.reply_id and photo.geo_valid=1 and photo.album_type='MallReply'
|
|
|
|
|
+ and reply.item_type=#{itemType}
|
|
|
|
|
+ group by photo.album_id
|
|
|
|
|
+ order by photo.id desc
|
|
|
|
|
+ limit #{pageSize}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="findImagePostInfo" resultType="cn.reghao.tnb.content.app.geo.model.vo.MarkerInfo">
|
|
|
|
|
+ select object_id as upload_id,album_id as item_id,channel_code,photo_url
|
|
|
|
|
+ from geo_camera_photo
|
|
|
|
|
+ where id=#{id} and geo is not null
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="findMallReplyInfo" resultType="cn.reghao.tnb.content.app.geo.model.vo.MarkerInfo">
|
|
|
select reply.item_id,reply.reply_id,reply.extra as sku,reply.reply_content,reply.append_content,
|
|
select reply.item_id,reply.reply_id,reply.extra as sku,reply.reply_content,reply.append_content,
|
|
|
photo.object_id as upload_id,photo.channel_code,photo.photo_url
|
|
photo.object_id as upload_id,photo.channel_code,photo.photo_url
|
|
|
from geo_camera_photo photo
|
|
from geo_camera_photo photo
|
|
@@ -91,19 +100,14 @@
|
|
|
from geo_camera_photo
|
|
from geo_camera_photo
|
|
|
where id=#{id} and geo is not null
|
|
where id=#{id} and geo is not null
|
|
|
</select>
|
|
</select>
|
|
|
- <select id="findAlbumMarkerInfo" resultType="cn.reghao.tnb.content.app.geo.model.vo.MarkerInfo">
|
|
|
|
|
- select object_id as upload_id,album_id as item_id,channel_code,photo_url
|
|
|
|
|
- from geo_camera_photo
|
|
|
|
|
- where id=#{id} and geo is not null
|
|
|
|
|
- </select>
|
|
|
|
|
- <select id="findByAlbumId" resultType="cn.reghao.tnb.content.app.geo.model.po.CameraPhoto">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <select id="findById" resultType="cn.reghao.tnb.content.app.geo.model.po.CameraPhoto">
|
|
|
select *
|
|
select *
|
|
|
from geo_camera_photo
|
|
from geo_camera_photo
|
|
|
- where album_id=#{albumId}
|
|
|
|
|
|
|
+ where id=#{id}
|
|
|
</select>
|
|
</select>
|
|
|
- <select id="findByAlbumType" resultType="cn.reghao.tnb.content.app.geo.model.po.CameraPhoto">
|
|
|
|
|
|
|
+ <select id="findAll" resultType="cn.reghao.tnb.content.app.geo.model.po.CameraPhoto">
|
|
|
select *
|
|
select *
|
|
|
from geo_camera_photo
|
|
from geo_camera_photo
|
|
|
- where album_type is null
|
|
|
|
|
</select>
|
|
</select>
|
|
|
</mapper>
|
|
</mapper>
|