我使用postgis来计算2个地理坐标之间的距离.
select st_distance(
'POINT(15.651955 73.712769)'::geography,
'POINT(14.806993 74.131451)'::geography) AS d;
Run Code Online (Sandbox Code Playgroud)
它返回我53536.743496517米,大约等于54km,但实际距离是103km,我通过http://boulter.com/gps/distance/计算
我在查询中做错了吗?
我有一个ArrayList有firmId, firmName,address,phoneNumber,status 领域的公司.我想动态分配firmId给每一行.
<s:iterator value="firms">
<tr>
<td align="left" class="Edit">
<img src="../images/btn-edit.png" title="Edit" width="27" height="25" alt='Edit' />
</td>
<td align="left"><s:property value="firmName" /></td>
<td align="left"><s:property value="address" /></td>
<td align="left"><s:property value="phoneNumber" /></td>
<td align="left"><s:property value="status" /></td>
</tr>
</s:iterator>
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
我有2个Entity类ParameterGroupBean和GroupLevelBean
import javax.persistence.*;
import java.util.ArrayList;
import java.util.Collection;
@Entity
@Table(name="tbl_ParameterGroups")
public class ParameterGroupBean {
@Id
@GeneratedValue
private int ParameterGroupId;
private String ParameterGroupName;
private Boolean Status;
@ManyToOne
@JoinColumn(name="LevelId")
private GroupLevelBean level = new GroupLevelBean();
public GroupLevelBean getLevel() {
return level;
}
public void setLevel(GroupLevelBean level) {
this.level = level;
}
@Id
@GeneratedValue
public int getParameterGroupId() {
return ParameterGroupId;
}
public void setParameterGroupId(int parameterGroupId) {
ParameterGroupId = parameterGroupId;
}
@Column(length=120)
public String getParameterGroupName() {
return ParameterGroupName;
}
public void setParameterGroupName(String parameterGroupName) {
ParameterGroupName …Run Code Online (Sandbox Code Playgroud) 我在Grails应用程序中集成了Spring安全核心插件.
grails.plugins.springsecurity.successHandler.defaultTargetUrl = "/user/home"
Run Code Online (Sandbox Code Playgroud)
这是我在成功登录后设置默认主页所做的工作.但我希望根据用户角色拥有不同的主页
目前我有2个用户角色1)"ROLE_ADMIN"2)"ROLE_USER"
我该如何实现?