111
fei.wang
2025-04-18 a6686570ac48648e2bf2ec93d27272a4473cac08
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.hxzkappboot.controller;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hxzkappboot.mapper.TbDepartmentMapper;
import com.hxzkappboot.mapper.TbWarnmesMapper;
import com.hxzkappboot.pojo.TbDepartment;
import com.hxzkappboot.pojo.TbWarnmes;
import com.hxzkappboot.service.TbWarnmesService;
import com.hxzkappboot.util.R;
import com.hxzkappboot.util.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
 
import javax.validation.Valid;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
 
 
@RestController
public class TbWarnmesController {
 
    @Autowired
    TbWarnmesMapper tbWarnmesMapper;
 
    @GetMapping({"/api/wx/findWarnmes"})
    public R findWarnmes(String type) throws ParseException {
        R response ;
        QueryWrapper queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type",type);
        response = new R(StatusCode.Success);
        response.setData( tbWarnmesMapper.selectOne(queryWrapper));
        return response;
    }
 
 
    @PostMapping("/api/wx/saveWarnmes")
    public void saveWarnmes(@Valid @RequestBody TbWarnmes tbWarnmes) {
//        R response;
 
        QueryWrapper queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type",tbWarnmes.getType());
//        tbDepartmentMapper.selectList(queryWrapper);
        tbWarnmesMapper.update(tbWarnmes,queryWrapper);
 
 
    }
}