You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB
Java

1 year ago
package com.supervision.controller;
1 year ago
import cn.hutool.core.map.MapUtil;
import com.supervision.ngbatis.dao.tag.ItemBranchDao;
import com.supervision.ngbatis.domain.tag.ItemBranch;
1 year ago
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
1 year ago
import java.util.HashMap;
import java.util.List;
import java.util.Map;
1 year ago
@RestController
@RequestMapping("test")
@RequiredArgsConstructor
public class TestController {
@Resource
private ItemBranchDao itemBranchDao;
1 year ago
@GetMapping("testInsert")
public void testInsert() {
1 year ago
ItemBranch itemBranch = new ItemBranch();
itemBranch.setItemName("退休");
itemBranchDao.insert(itemBranch);
}
1 year ago
@GetMapping("testQuery")
public List<ItemBranch> testQuery(){
Map<String, Object> param = MapUtil.builder(new HashMap<String, Object>()).put("item_name", "退休").build();
return itemBranchDao.selectByMap(param);
}
1 year ago
}