删除模板
@Autowired
IdcZbCalligraphylibrarybeexampledetail idcZbCalligraphylibrarybeexampledetail;
@Autowired
IdcZbCalligraphylibrarybeexampledetailMapper idcZbCalligraphylibrarybeexampledetailMapper;
@ApiOperation(value = "根据id删除汉字图片")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "输入查询语句", dataType = "String", dataTypeClass = String.class)
})
@GetMapping("deleteTitledayidp")
public Integer deleteTitledayidp(@RequestParam(value = "id") Long id) {
MPJLambdaWrapper<IdcZbCalligraphylibrarybeexampledetail> MPJLambdaWrapper = new MPJLambdaWrapper<IdcZbCalligraphylibrarybeexampledetail>()
.eq(IdcZbCalligraphylibrarybeexampledetail::getCalligraphylibrarybe, id);
return idcZbCalligraphylibrarybeexampledetailMapper.delete(MPJLambdaWrapper);
}
查询模板
在这里插入代码片 @ApiOperation(value = "根据id查询汉字图片")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "输入查询语句", dataType = "String", dataTypeClass = String.class)
})
@GetMapping("searchTitledayidp")
public List<Map<String, Object>> searchTitledayidp(@RequestParam(value = "id" ) Long id) {
MPJLambdaWrapper<IdcZbCalligraphylibrarybeexampledetail> MPJLambdaWrapper = new MPJLambdaWrapper<IdcZbCalligraphylibrarybeexampledetail>()
.eq(IdcZbCalligraphylibrarybeexampledetail::getCalligraphylibrarybe,id)
.select(IdcZbCalligraphylibrarybeexampledetail::getIdc,
IdcZbCalligraphylibrarybeexampledetail::getCalligraphylibrarydetailserial,
IdcZbCalligraphylibrarybeexampledetail::getPicurl,
IdcZbCalligraphylibrarybeexampledetail::getAliurl,
IdcZbCalligraphylibrarybeexampledetail::getDescription);
return idcZbCalligraphylibrarybeexampledetailMapper.selectMaps(MPJLambdaWrapper);
}
修改模板
@Autowired
IdcZbCalligraphylibrarybeexampledetail idcZbCalligraphylibrarybeexampledetail;
@ApiOperation(value = "根据对应id修改汉字图片")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", dataTypeClass = Long.class),
@ApiImplicitParam(name = "Picurl", value = "图片地址", dataType = "String", dataTypeClass = String.class),
@ApiImplicitParam(name = "Calligraphylibrarydetailserial", value = "写法版本号", dataType = "String", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "Description", value = "解释", dataType = "String", dataTypeClass = String.class)
})
@GetMapping("searchTitledayidpUP")
public Integer searchTitledayidpUP(@RequestParam(value = "id" ) Long id,
@RequestParam(value = "Picurl", required = false) String Picurl,
@RequestParam(value = "Calligraphylibrarydetailserial", required = false) Integer Calligraphylibrarydetailserial,
@RequestParam(value = "Description", required = false) String Description
) {
if (Calligraphylibrarydetailserial== null&&Picurl == null&&Description == null){
return 0;
}
if (Calligraphylibrarydetailserial != null) {
idcZbCalligraphylibrarybeexampledetail.setCalligraphylibrarydetailserial(Calligraphylibrarydetailserial);
}
if (Picurl != null) {
idcZbCalligraphylibrarybeexampledetail.setPicurl(Picurl);
}
if (Description != null) {
idcZbCalligraphylibrarybeexampledetail.setDescription(Description);
}
return idcZbCalligraphylibrarybeexampledetailMapper.update(idcZbCalligraphylibrarybeexampledetail, new QueryWrapper<IdcZbCalligraphylibrarybeexampledetail>().eq("Idc", id));
}
添加模板
@ApiOperation(value = "创建用户")
@ApiImplicitParams({
@ApiImplicitParam(name = "School", value = "学校", dataType = "String", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = "Password", value = "密码", dataType = "String", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = "Name", value = "姓名 昵称和姓名相同", dataType = "String", paramType = "query", dataTypeClass = String.class)
})
@GetMapping("insertWebUser")
public IdcZbCoursewareuser insertWebUser(@RequestParam("phone") String phone,//手机号
@RequestParam("Password") String Password,//密码
@RequestParam("Name") String Name,//姓名
@RequestParam("School") String School//学校
) {//学校
Long dates;
synchronized (this) {
idcZbCoursewareuserMapper.updateCurrentindex();
dates = idcZbCoursewareuserMapper.selectCurrentindex();
}
idcZbCoursewareuser.setSysversion(0);
idcZbCoursewareuser.setShortname(Name);
idcZbCoursewareuser.setStatus(1);
idcZbCoursewareuser.setPassword(Password);
idcZbCoursewareuser.setName(Name);
idcZbCoursewareuser.setPhone(phone);
idcZbCoursewareuser.setSchool(School);
try {
Date date = new Date();
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(date);
String format2 = new SimpleDateFormat("yyyyMMdd").format(date);
Date parse = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").parse(format);
idcZbCoursewareuser.setIdc(Long.valueOf(format2 + dates));
idcZbCoursewareuser.setCreatetime(parse);
idcZbCoursewareuser.setEndtime(parse);
idcZbCoursewareuser.setModifyon(parse);
idcZbCoursewareuser.setCode("CU" + "-" + returnPlace.getShortname() + "-" + format2.substring(0, 6) + "-" + dates);
} catch (ParseException e) {
e.printStackTrace();
}
idcZbCoursewareuser.setCreateby("用户注册");
idcZbCoursewareuser.setModifyby("用户注册");
idcZbCoursewareuser.setIsformal(false);
idcZbCoursewareuser.setIsonly(false);
idcZbCoursewareuser.setClassnumber(1);
idcZbCoursewareuserMapper.insert(idcZbCoursewareuser);
return idcZbCoursewareuser;
}