| | |
| | | |
| | | <!--自定义查询合同分页数据--> |
| | | <select id="selectElectronRailPage" resultType="org.springblade.modules.electronrail.vo.ElectronRailVO"> |
| | | select * from sys_electron_rail |
| | | select id,type,name,ST_ASTEXT(coordinate) as coordinate,create_time createTime,update_time updateTime from sys_electron_rail |
| | | where 1=1 |
| | | <if test="electronRail.name!=null and electronRail.name!=''"> |
| | | and name like concat('%',#{electronRail.name},'%') |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!--自定义新增电子围栏数据--> |
| | | <insert id="saveElectRailInfo"> |
| | | insert into sys_electron_rail |
| | | (name,type,company_id, |
| | | <if test="electronRail.coordinate!=null and electronRail.coordinate!=''"> |
| | | coordinate, |
| | | </if> |
| | | create_time,update_time) |
| | | values |
| | | (#{electronRail.name},#{electronRail.type},#{electronRail.companyId}, |
| | | <if test="electronRail.coordinate!=null and electronRail.coordinate!=''"> |
| | | ST_GeomFromText(${electronRail.coordinate}), |
| | | </if> |
| | | #{electronRail.createTime},#{electronRail.updateTime}) |
| | | </insert> |
| | | |
| | | <!--自定义修改电子围栏数据--> |
| | | <update id="updateElectronRailInfo"> |
| | | update sys_electron_rail set name = #{electronRail.name}, |
| | | type = #{electronRail.type}, |
| | | company_id = #{electronRail.companyId}, |
| | | <if test="electronRail.coordinate!=null and electronRail.coordinate!=''"> |
| | | coordinate = ST_GeomFromText(${electronRail.coordinate}), |
| | | </if> |
| | | update_time = #{electronRail.updateTime} |
| | | where id = #{electronRail.id} |
| | | </update> |
| | | |
| | | <!--判断一个点是否在区域内--> |
| | | <select id="isOnArea" resultType="java.lang.Integer"> |
| | | select ifnull(count(*),0) count from sys_electron_rail |
| | | where |
| | | MBRWithin(ST_GeomFromText('POINT(${electronRail.jd} ${electronRail.wd})'),coordinate) |
| | | and id = #{electronRail.id} |
| | | </select> |
| | | |
| | | </mapper> |