Commit a50d6e91 authored by Administrator's avatar Administrator

领物导航SQL

parent 513bb8dc
package com.dlbridge.jadp.plugins.cmpt.dao.mapper;
import com.dlbridge.jadp.plugins.cmpt.dao.model.LocationPoint;
import com.dlbridge.jadp.plugins.cmpt.dao.model.PointRecord;
import com.dlbridge.jadp.plugins.cmpt.dao.model.UserPoint;
import com.dlbridge.jadp.plugins.partner.bean.BagDelivery;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 领物导航Mapper
*
*/
public interface LocationMapper {
void addLocationCategory(LocationPoint locationPoint);
void insertLocationPoint(LocationPoint locationPoint);
int delLocationPoint(@Param("id") Integer id);
int delLocationCategory(@Param("catId") Integer catId);
int updateLocationPoint(LocationPoint locationPoint);
List<LocationPoint> queryLocationList(@Param("cmptId") Integer cmptId, @Param("catId") Integer catId);
}
\ No newline at end of file
<?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="com.dlbridge.jadp.plugins.cmpt.dao.mapper.LocationMapper">
<select id="addLocationCategory" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.LocationPoint">
call AddLocationCategory(#{cmptId},#{catId},#{catName},#{icon},#{sortOrder})
</select>
<insert id="insertLocationPoint">
insert into location_point(category_id ,name,longitude,latitude,description,sort_order)
values( #{bag.catId},#{bag.catName},#{bag.longitude},#{bag.latitude},#{bag.description},#{bag.sortOrder})
</insert>
<delete id="delLocationPoint">
delete from location_point where id = #{id}
</delete>
<delete id="delLocationCategory">
delete from location_category where id = #{catId}
</delete>
<update id="updateLocationPoint">
update location_point
set name = #{name}
, longitude = #{longitude}
, latitude = #{latitude}
, description = #{description}
, sort_order = #{sortOrder}
where id = #{id}
</update>
<select id="queryLocationList" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.LocationPoint">
SELECT
c.cmpt_id cmptId,
c.id AS catId,
c.name AS catName,
c.level,
p.id AS pointId,
p.name AS pointName,
p.longitude,
p.latitude,
p.`description`,
p.sort_order sortOrder
FROM location_category c
LEFT JOIN location_point p ON c.id = p.category_id
WHERE c.id IN (
SELECT descendant_id
FROM location_category_path
WHERE ancestor_id = #{catId}
)
and c.cmpt_id = #{cmptId}
ORDER BY c.level, c.sort_order, p.sort_order;
</select>
</mapper>
\ No newline at end of file
package com.dlbridge.jadp.plugins.cmpt.dao.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@ApiModel(value = "领物导航实体类", description = "领物导航实体类")
@Data
public class LocationPoint {
@ApiModelProperty(value = "赛事ID", notes = "赛事ID")
private Integer cmptId;
@ApiModelProperty(value = "所属分类ID", notes = "所属分类ID")
private Integer catId;
@ApiModelProperty(value = "分类名", notes = "分类名")
private String catName;
@ApiModelProperty(value = "层级", notes = "层级")
private Integer level;
@ApiModelProperty(value = "图标URL", notes = "图标URL")
private String icon;
@ApiModelProperty(value = "点位ID", notes = "点位ID")
private Integer pointId;
@ApiModelProperty(value = "点位名", notes = "点位名")
private String pointName;
@ApiModelProperty(value = "经度", notes = "经度")
private BigDecimal longitude;
@ApiModelProperty(value = "纬度", notes = "纬度")
private BigDecimal latitude;
@ApiModelProperty(value = "描述", notes = "描述")
private String description;
@ApiModelProperty(value = "排序", notes = "排序")
private Integer sortOrder;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment