| | |
| | | LEFT JOIN blade_user bus on bus.id = jpag.police_user_id |
| | | left join ( |
| | | select a.* from jczz_place_poi_label a inner join |
| | | ( |
| | | select place_id,max(id) as id from jczz_place_poi_label b group by place_id |
| | | ) b on a.id = b.id |
| | | ( select place_id,max(id) as id from jczz_place_poi_label b group by place_id ) b on a.id = b.id |
| | | ) jppl on jppl.place_id = jp.id |
| | | where jp.is_deleted = 0 and jp.source!=3 |
| | | and jp.place_name != '' |
| | | <if test="place.poiCodeList !=null and place.poiCodeList.size()>0"> |
| | | and jppl.poi_code in |
| | | <foreach collection="place.poiCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </if> |
| | | <if test="place.placeName!=null and place.placeName!=''"> |
| | | and jp.place_name like concat('%',#{place.placeName},'%') |
| | | </if> |
| | |
| | | <if test="place.isNine!=null"> |
| | | and jp.is_nine = #{place.isNine} |
| | | </if> |
| | | |
| | | <if test="place.noExplosionCategory!=null"> |
| | | and jp.no_explosion_category is not null |
| | | <if test="place.noExplosionCategory!=null and place.noExplosionCategory > 0 "> |
| | | and jp.no_explosion_category = #{place.noExplosionCategory} |
| | | </if> |
| | | </if> |
| | | |
| | | |
| | | <if test="place.source!=null"> |
| | | and jp.source = #{place.source} |
| | |
| | | </if> |
| | | <if test="place.deptName!=null and place.deptName!=''"> |
| | | and jpag.pcs_name like concat('%',#{place.deptName},'%') |
| | | </if> |
| | | |
| | | <if test="place.startTime != null and place.startTime != '' and place.endTime != null and place.endTime != '' "> |
| | | AND jp.create_time BETWEEN #{place.startTime} and #{place.endTime} |
| | | </if> |
| | | |
| | | <if test="place.policeName!=null and place.policeName!=''"> |
| | |
| | | order by jp.create_time desc,jp.id desc |
| | | </select> |
| | | |
| | | <select id="getNearbyPlaceList" resultType="org.springblade.modules.place.vo.PlaceVO"> |
| | | SELECT |
| | | jp.id, |
| | | jp.lat, |
| | | jp.lng, |
| | | jp.place_name, |
| | | ( 6371 * acos( cos( radians(#{param1}) ) * cos( radians( jp.lat ) ) |
| | | * cos( radians( jp.lng ) - radians(#{param2}) ) |
| | | + sin( radians(#{param1}) ) * sin( radians( jp.lat ) ) ) ) AS distance |
| | | FROM jczz_place jp |
| | | where jp.place_name is not null |
| | | and jp.lat is not null |
| | | and jp.lng is not null |
| | | and jp.is_deleted = 0 |
| | | HAVING distance <= 1 |
| | | ORDER BY distance limit 60 |
| | | </select> |
| | | |
| | | </mapper> |