mybatis plus join 增删改查 模板 方法语句 +(swagger 接口文档语句 )

删除模板

 @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;
    }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zzsaixuexi

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值