52,797
社区成员
发帖
与我相关
我的任务
分享
function next(){
var str="46ecc0c0-4616-434d-9084-8e354fc34e63,5d06a3f0-e285-4982-acfd-d0602dba1f27".split(",");
var id=GetQueryString("id");
//size()
for(var i=0;i<str.length;i++){
if(id==str[i]){
index=i;
}
}
// alert(index);
if((index+1)>str.length){
index=str.length-1;
}else{
index=index+1;
}
//跳转
var str=xxx.split(",");
中应用什么格式表示数组。public class Feedback implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private String id;
private String title;
private String category;
private String status;
private String createUserId;
private String createUserName;
private Long reading;
private Date createDate;
private String lastModifyUserId;
private String lastModifyUserName;
private Date lastModifyDate;
private String docText;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
<insert id="insert" parameterType="com.huacainfo.ace.weui.model.Feedback">
insert into feedback (id, title, category,
status, createUserId, createUserName,
reading, createDate, lastModifyUserId,
lastModifyUserName, lastModifyDate, docText
)
values (#{id,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR},
#{status,jdbcType=CHAR}, #{createUserId,jdbcType=VARCHAR}, #{createUserName,jdbcType=VARCHAR},
#{reading,jdbcType=BIGINT}, #{createDate,jdbcType=TIMESTAMP}, #{lastModifyUserId,jdbcType=VARCHAR},
#{lastModifyUserName,jdbcType=VARCHAR}, #{lastModifyDate,jdbcType=TIMESTAMP}, #{docText,jdbcType=LONGVARCHAR}
)
</insert>
<select id="query" resultType="map">
select t.id,t.name,t.image,a.name author,DATE_FORMAT(t.dateOfPublication, '%Y-%m-%d') dateOfPublication,
b.name category,ifnull(t.reading,0) reading
from writing t
left join writer a on t.author=a.id
left join ( SELECT
CODE,
NAME
FROM
portal.dict
WHERE
category_id = '84') b on t.category=b.code
where t.status='1'
<if test='condition.name!=null and condition.name!=""'>
and t.name like
concat('%',#{condition.name,jdbcType=VARCHAR},'%')
</if>
<if test="condition.category!=null and condition.category!=""">
and t.category =#{condition.category,jdbcType=VARCHAR}
</if>
<if test="condition.author!=null and condition.author!=""">
and t.author =#{condition.author,jdbcType=VARCHAR}
</if>
ORDER BY t.dateOfPublication desc
limit #{start,jdbcType=DECIMAL}, #{limit,jdbcType=DECIMAL}
</select>
var tempStr='aa,bb,cc,dd';
var tempArray=tempStr.split(',');//以逗号进行分割
console.log(tempArray); // 输出[aa,bb,cc,dd]
console.log(tempArray[0]); //输出第一项aa
$.ajax({
。。。。。。。。。。。
。。。。。。。。。。。
success: function (rst) {
next(rst.value);//要在这里调用函数并获取数据
}
});
function next(arr){
var id=GetQueryString("id");
//size()
for(var i=0;i<arr.length;i++){
if(id==arr[i].id){
index=i;
}
}
// alert(index);
if((index+1)>arr.length){
index=arr.length-1;
}else{
index=index+1;
}
//跳转