js/jsfun/fnDb_singledb.js 单数据库模式数据库操作类
//查询
let list = BllDoctype.doctypeQuery();
console.log("查询列表:", list);
let list2 = BllDoctype.doctypeQuery("pkid,ctitle", {"cstatus": 1, "ctitle|like": "%开%"}, "order by pkid desc")
console.log("查询列表2:", list2);
let list3 = BllDoctype.doctypeQuery("cstatus", {"ctitle|like": "%开%"}, "group by cstatus")
console.log("查询列表3:", list3);
console.log("查询行数据:", BllDoctype.doctypeInfo(14))
let row = BllDoctype.doctypeQueryRow("pkid,ctitle", {"ctitle|like": "%开%"}, "order by pkid desc")
let _info = new ModDoctype(row);
console.log("info==>", _info);
let tInfo = {"ctitle": "AAAA", "pkid": 0};
console.log("===>", new ModDoctype(tInfo))
tInfo["ctitle"] = undefined;
console.log("===>", new ModDoctype(tInfo))
console.log("查询行:", row);
console.log("总条数:", BllDoctype.doctypeCount({"cstatus": 1}))
//分页
//无统计数据
let page= BllDoctype.doctypePage("*",{"cstatus":1},"order by pkid desc")
console.log("分页:", page)
//有统计数据
let page2= BllDoctype.doctypePageCount("pkid,ctitle",{"cstatus":1},"order by pkid desc",3,1)
console.log("分页2:", page2)
//新增数据
let newID= BllDoctype.doctypeInsert({"ctitle":"AAAAAAAAA"})
console.log("新增数据:", newID);
console.log("新增数据1:",BllDoctype.doctypeInfo(newID))
//更新数据
BllDoctype.doctypeUpdateByID(newID,{"ctitle":null})
console.log("新增数据2:",BllDoctype.doctypeInfo(newID))
//删除数据
console.log("删除条数:", BllDoctype.doctypeDelete({"cstatus": -2}));
console.log("删除指定ID的条数:", BllDoctype.doctypeDeleteByID(200))