main
黄海 10 months ago
parent 72acf3fafe
commit ae4e09b5e0

@ -1,10 +1,12 @@
/* 下面代码开始维护维修记录表 */
//增加维修记录表
@Before({POST.class})
//@JwtCheckInterface({})
//@EmptyInterface({""})
//@IsNumericInterface({})
public void addWxRecord(int station_id , String station_name , int equipmentId , String equipmentName , int connectorId , String connectorNo , String wx_openid , int status_id , int type_id , String type_name , String memo ){
wm.addWxRecord(station_id , station_name , equipmentId , equipmentName , connectorId , connectorNo , wx_openid , status_id , type_id , type_name , memo ,)
ym.addWxRecord(station_id , station_name , equipmentId , equipmentName , connectorId , connectorNo , wx_openid , status_id , type_id , type_name , memo );
renderJson(RetKit.renderSuccess());
}
@ -14,7 +16,7 @@
//@EmptyInterface({""})
//@IsNumericInterface({"id"})
public void delWxRecordById(int id){
wm.delWxRecordById(id);
ym.delWxRecordById(id);
renderJson(RetKit.renderSuccess());
}
@ -24,7 +26,7 @@
//@EmptyInterface({""})
//@IsNumericInterface({"id"})
public void updateWxRecordById(int id,int station_id , String station_name , int equipmentId , String equipmentName , int connectorId , String connectorNo , String wx_openid , int status_id , int type_id , String type_name , String memo ){
wm.updateWxRecordById(station_id , station_name , equipmentId , equipmentName , connectorId , connectorNo , wx_openid , status_id , type_id , type_name , memo ,);
ym.updateWxRecordById(id,station_id , station_name , equipmentId , equipmentName , connectorId , connectorNo , wx_openid , status_id , type_id , type_name , memo );
renderJson(RetKit.renderSuccess());
}
@ -34,7 +36,7 @@
//@EmptyInterface({""})
//@IsNumericInterface({"id"})
public void getWxRecordById(int id){
renderJson(RetKit.renderSuccess(wm.getWxRecordById(id)));
renderJson(RetKit.renderSuccess(ym.getWxRecordById(id)));
}
//分页查询维修记录表
@ -42,7 +44,7 @@
//@JwtCheckInterface({})
//@EmptyInterface({""})
public void getWxRecordList(int pageNum, int pageSize){
Page<Record> listPage = wm.getWxRecordList(pageNum, pageSize);
Page<Record> listPage = ym.getWxRecordList(pageNum, pageSize);
renderJson(RetKit.renderSuccess(listPage));
}

@ -24,8 +24,8 @@
//修改维修记录表
public void updateWxRecordById(int id,int station_id , String station_name , int equipmentId , String equipmentName , int connectorId , String connectorNo , String wx_openid , int status_id , int type_id , String type_name , String memo ){
String sql="update t_wx_record set station_id= ?,station_name= ?,equipmentId= ?,equipmentName= ?,connectorId= ?,connectorNo= ?,wx_openid= ?,status_id= ?,create_time= ?,type_id= ?,type_name= ?,memo= ? where id=?";
Db.update(sql,station_id , station_name , equipmentId , equipmentName , connectorId , connectorNo , wx_openid , status_id , create_time , type_id , type_name , memo , id);
String sql="update t_wx_record set station_id= ?,station_name= ?,equipmentId= ?,equipmentName= ?,connectorId= ?,connectorNo= ?,wx_openid= ?,status_id= ?,create_time= DateTime.now(),type_id= ?,type_name= ?,memo= ? where id=?";
Db.update(sql,station_id , station_name , equipmentId , equipmentName , connectorId , connectorNo , wx_openid , status_id , type_id , type_name , memo , id);
}
//单条查询维修记录表
@ -36,6 +36,8 @@
//分页查询维修记录表
public Page<Record> getWxRecordList(int pageNum, int pageSize){
String sql1="select * " String sql2="fromt_wx_record " return Db.paginate(pageNum, pageSize, sql1,sql2);
String sql1="select * ";
String sql2="fromt_wx_record ";
return Db.paginate(pageNum, pageSize, sql1,sql2);
}

@ -1,6 +0,0 @@
Controller
RetKit.renderSuccess("操作成功")-->RetKit.renderSuccess()
stage_id 这个不知道是从哪里来的

@ -206,6 +206,9 @@ public class GenerateCode {
fullParameters = fullParameters.substring(0, fullParameters.length() - 1);
}
parameters = parameters.substring(0, parameters.length() - 1);
if (parameters.endsWith(",")) {
parameters = parameters.substring(0, parameters.length() - 1);
}
//后缀名称
String beanNameWithoutT = jo.getStr("beanNameWithoutT");
if (beanNameWithoutT.startsWith("T")) {
@ -222,6 +225,8 @@ public class GenerateCode {
StringBuilder sb = new StringBuilder();
//sb.append("//-------------------下面是Controller部分-------------------\n");
sb.append("/* 下面代码开始维护" + comment + " */\n");
sb.append("\n");
//1、增加
sb.append(" //增加" + comment + "\n");
sb.append(" @Before({POST.class})\n");
@ -229,7 +234,7 @@ public class GenerateCode {
sb.append(" //@EmptyInterface({\"\"})\n");
sb.append(" //@IsNumericInterface({})\n");
sb.append(" public void add" + beanNameWithoutT + "(" + fullParameters + "){\n");
sb.append(" " + PropKit.get("daoName") + ".add" + beanNameWithoutT + "(" + parameters + ")\n");
sb.append(" " + PropKit.get("daoName") + ".add" + beanNameWithoutT + "(" + parameters + ");\n");
sb.append(" renderJson(RetKit.renderSuccess());\n");
sb.append(" }\n");
@ -253,7 +258,7 @@ public class GenerateCode {
sb.append(" //@EmptyInterface({\"\"})\n");
sb.append(" //@IsNumericInterface({\"id\"})\n");
sb.append(" public void update" + beanNameWithoutT + "ById(" + key_type + " " + key + "," + fullParameters + "){\n");
sb.append(" " + PropKit.get("daoName") + ".update" + beanNameWithoutT + "ById(" + parameters + ");\n");
sb.append(" " + PropKit.get("daoName") + ".update" + beanNameWithoutT + "ById(" + key + "," + parameters + ");\n");
sb.append(" renderJson(RetKit.renderSuccess());\n");
sb.append(" }\n");
sb.append("\n");
@ -312,14 +317,20 @@ public class GenerateCode {
sb.append(" public void update" + beanNameWithoutT + "ById(" + key_type + " " + key + "," + fullParameters + "){\n");
sb.append(" String sql=\"update " + table + " set ");
for (Map.Entry<String, String> entry : fields.entrySet()) {
if (!entry.getKey().equals("create_time")) {
sb.append(entry.getKey() + "= ?,");
} else {
sb.append(entry.getKey() + "= DateTime.now(),");
}
}
sb = sb.deleteCharAt(sb.length() - 1);
sb.append(" where " + key + "=?\";\n");
sb.append(" Db.update(sql,");
for (Map.Entry<String, String> entry : fields.entrySet()) {
if(!entry.getKey().equals("create_time")){
sb.append(entry.getKey() + " , ");
}
}
sb.append(key);
sb.append(");\n");
sb.append(" }\n");
@ -335,8 +346,8 @@ public class GenerateCode {
//5、分页查询
sb.append(" //分页查询" + comment + "\n");
sb.append(" public Page<Record> get" + beanNameWithoutT + "List(int pageNum, int pageSize){\n");
sb.append(" String sql1=\"select * \"");
sb.append(" String sql2=\"from" + table + " \"");
sb.append(" String sql1=\"select * \";\n");
sb.append(" String sql2=\"from" + table + " \";\n");
sb.append(" return Db.paginate(pageNum, pageSize, sql1,sql2);\n");
sb.append(" }\n");
sb.append("\n");

@ -11,7 +11,7 @@ beanPath=D:/dsWork/dsProject/dsUtils/src/main/java/com/dsideal/Code
tableName=t_wx_record
# dao的名称
daoName=wm
daoName=ym

@ -11,7 +11,7 @@ beanPath=D:/dsWork/dsProject/dsUtils/src/main/java/com/dsideal/Code
tableName=t_wx_record
# dao的名称
daoName=wm
daoName=ym

Loading…
Cancel
Save