|
|
@@ -0,0 +1,55 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+
|
|
|
+<mapper namespace="cn.reghao.tnb.mall.app.geo.db.mapper.JobLocationMapper">
|
|
|
+ <insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into geo_job_location
|
|
|
+ (`company_name`,`issue_date`,`job_href`,`job_describe`,`salary_min`,`salary_max`,`salary_str`,`geo`)
|
|
|
+ values
|
|
|
+ (#{companyName},#{issueDate},#{jobHref},#{jobDescribe},#{salaryMin},#{salaryMax},#{salaryStr},point(#{longitude},#{latitude}))
|
|
|
+ </insert>
|
|
|
+ <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert ignore into geo_job_location
|
|
|
+ (`company_name`,`issue_date`,`job_href`,`job_describe`,`salary_min`,`salary_max`,`salary_str`,`geo`)
|
|
|
+ values
|
|
|
+ <foreach collection="list" item="item" index="index" separator=",">
|
|
|
+ (#{item.companyName},#{item.issueDate},#{item.jobHref},#{item.jobDescribe},#{item.salaryMin},#{item.salaryMax},#{item.salaryStr},point(#{item.longitude},#{item.latitude}))
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <resultMap id="photoGeo" type="cn.reghao.tnb.mall.app.geo.model.po.MallReplyPhoto">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="replyId" column="reply_id"/>
|
|
|
+ <result property="photoUrl" column="photo_url"/>
|
|
|
+ <association property="geoPoint" javaType="cn.reghao.tnb.mall.app.geo.model.vo.MapPoint">
|
|
|
+ <result property="lng" column="lng"/>
|
|
|
+ <result property="lat" column="lat"/>
|
|
|
+ </association>
|
|
|
+ </resultMap>
|
|
|
+ <select id="findAll" resultMap="photoGeo">
|
|
|
+ select id,reply_id,photo_url,x(geo) as lng,y(geo) as lat
|
|
|
+ from geo_job_location
|
|
|
+ </select>
|
|
|
+ <select id="findMarkerInfoById" resultType="cn.reghao.tnb.mall.app.geo.model.vo.MarkerInfo">
|
|
|
+ select reply.item_id,reply.reply_id,reply.extra as sku,reply.reply_content,reply.append_content,
|
|
|
+ photo.upload_id,photo.channel_id,photo.photo_url
|
|
|
+ from geo_job_location photo
|
|
|
+ inner join geo_mall_reply reply
|
|
|
+ on photo.reply_id=reply.reply_id and photo.id=#{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <resultMap id="mapMarker" type="cn.reghao.tnb.mall.app.geo.model.vo.MapMarker">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="title" column="company_name"/>
|
|
|
+ <association property="position" javaType="cn.reghao.tnb.mall.app.geo.model.vo.MapPoint">
|
|
|
+ <result property="lng" column="lng"/>
|
|
|
+ <result property="lat" column="lat"/>
|
|
|
+ </association>
|
|
|
+ </resultMap>
|
|
|
+ <select id="findMapMarker" resultMap="mapMarker">
|
|
|
+ select id,company_name,x(geo) as lng,y(geo) as lat
|
|
|
+ from geo_job_location photo
|
|
|
+ order by issue_date desc
|
|
|
+ limit 1000
|
|
|
+ </select>
|
|
|
+</mapper>
|