init
This commit is contained in:
13
src/main/java/com/exam/sb/SbApplication.java
Normal file
13
src/main/java/com/exam/sb/SbApplication.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.exam.sb;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class SbApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SbApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
127
src/main/java/com/exam/sb/controller/ApiController.java
Normal file
127
src/main/java/com/exam/sb/controller/ApiController.java
Normal file
@ -0,0 +1,127 @@
|
||||
package com.exam.sb.controller;
|
||||
|
||||
import com.exam.sb.entity.Person_805Entity;
|
||||
import com.exam.sb.entity.Person_health_805Entity;
|
||||
import com.exam.sb.entity.User_70Entity;
|
||||
import com.exam.sb.service.Person_805Service;
|
||||
import com.exam.sb.service.User_70Service;
|
||||
import com.exam.sb.vo.PersonHealthVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.DigestUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api")
|
||||
public class ApiController {
|
||||
@RequestMapping("get_1")
|
||||
public String get_1(){
|
||||
return "spring-boot";
|
||||
}
|
||||
@RequestMapping("get_2")
|
||||
public String get_2(String name){
|
||||
return name;
|
||||
}
|
||||
@Autowired
|
||||
User_70Service user_70Service;
|
||||
@RequestMapping("register_803_2")
|
||||
public String register_803_2(User_70Entity user_70Entity){
|
||||
if(user_70Service.select(user_70Entity.getName())==null){
|
||||
//md5的处理 md5(aaaa)
|
||||
user_70Entity.setPassword(DigestUtils.md5DigestAsHex(user_70Entity.getPassword().getBytes()));
|
||||
user_70Service.insert(user_70Entity);
|
||||
return "新用户注册成功";
|
||||
}else{
|
||||
user_70Entity.setPassword(DigestUtils.md5DigestAsHex(user_70Entity.getPassword().getBytes()));
|
||||
user_70Service.update(user_70Entity);
|
||||
return "用户密码修改成功";
|
||||
}
|
||||
}
|
||||
//java session
|
||||
@RequestMapping("login_803_2")
|
||||
public String login_803_2(User_70Entity user_70Entity,
|
||||
HttpServletRequest httpServletRequest){
|
||||
user_70Entity.setPassword(DigestUtils.md5DigestAsHex(user_70Entity.getPassword().getBytes()));
|
||||
HttpSession httpSession=httpServletRequest.getSession();
|
||||
if(user_70Service.login(user_70Entity)==1){
|
||||
httpSession.setAttribute("name",user_70Entity.getName());// $_SESSION["name"]="mike"
|
||||
return "登录成功";
|
||||
|
||||
}else{
|
||||
httpSession.setAttribute("name","");// $_SESSION["name"]=""
|
||||
return "登录失败";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@RequestMapping("list_803_2")
|
||||
public String list_803_2(HttpServletRequest httpServletRequest){
|
||||
HttpSession httpSession=httpServletRequest.getSession();
|
||||
String returnValue="";
|
||||
try {
|
||||
returnValue=httpSession.getAttribute("name").toString();
|
||||
if(returnValue==""){
|
||||
returnValue="未受权,请先登录";
|
||||
}
|
||||
}catch (Exception e){
|
||||
returnValue="未受权,请先登录";
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
@Autowired
|
||||
Person_805Entity person_805Entity;
|
||||
@Autowired
|
||||
Person_health_805Entity person_health_805Entity;
|
||||
@Autowired
|
||||
Person_805Service person_805Service;
|
||||
|
||||
//提交的表单对应vo层
|
||||
@RequestMapping("ehrSet_805")
|
||||
public String ehrSet_805(PersonHealthVo personHealthVo){
|
||||
System.out.println("86---------");
|
||||
String id= UUID.randomUUID().toString().replace("_","").toLowerCase();
|
||||
//uniquID() k4h5kn_34KJKRJWEF_3K24J3K4K k4h5kn34KJKRJWEF3K24J3K4K
|
||||
//时间戳
|
||||
long now =new Date().getTime()/1000;
|
||||
person_805Entity.setSfz_id(personHealthVo.getSfz_id());
|
||||
person_805Entity.setName(personHealthVo.getName());
|
||||
person_805Entity.setGender(personHealthVo.getGender());
|
||||
person_805Entity.setEmr(personHealthVo.getEmr());
|
||||
System.out.println("94---------------");
|
||||
if(person_805Service.selectPerson_805(personHealthVo.getSfz_id())==null){
|
||||
System.out.println("inser---------");
|
||||
//新增
|
||||
person_805Entity.setCreate_time(now);
|
||||
person_805Entity.setUpdate_time(now);
|
||||
person_805Entity.setId(id);
|
||||
person_805Service.insertPerson_805(person_805Entity);
|
||||
}else{
|
||||
//编辑
|
||||
System.out.println("up--------------");
|
||||
person_805Entity.setUpdate_time(now);
|
||||
person_805Service.updatePerson_805(person_805Entity);
|
||||
}
|
||||
|
||||
person_health_805Entity.setId(id);
|
||||
person_health_805Entity.setSfz_id(personHealthVo.getSfz_id());
|
||||
person_health_805Entity.setSbp(personHealthVo.getSbp());
|
||||
person_health_805Entity.setDbp(personHealthVo.getDbp());
|
||||
person_health_805Entity.setCreate_time(now);
|
||||
person_health_805Entity.setUpdate_time(now);
|
||||
person_805Service.insertPerson_health_805(person_health_805Entity);
|
||||
|
||||
return person_805Entity.getName();
|
||||
|
||||
}
|
||||
@RequestMapping("ehrGet_805")
|
||||
public PersonHealthVo ehrGet_805(String sfz_id){
|
||||
return person_805Service.selectPersonHealthVo(sfz_id);
|
||||
}
|
||||
|
||||
|
||||
}
|
107
src/main/java/com/exam/sb/entity/Person_805Entity.java
Normal file
107
src/main/java/com/exam/sb/entity/Person_805Entity.java
Normal file
@ -0,0 +1,107 @@
|
||||
package com.exam.sb.entity;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class Person_805Entity {
|
||||
//id,sfz_id,name,gender,password,hometown,chronic_disease,birthday,emr,create_time,update_time
|
||||
private String id;
|
||||
private String sfz_id;
|
||||
private String name;
|
||||
private String gender;
|
||||
private String password;
|
||||
private String hometown;
|
||||
private String chronic_disease;
|
||||
private long birthday;
|
||||
private String emr;
|
||||
private long create_time;
|
||||
private long update_time;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSfz_id() {
|
||||
return sfz_id;
|
||||
}
|
||||
|
||||
public void setSfz_id(String sfz_id) {
|
||||
this.sfz_id = sfz_id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getHometown() {
|
||||
return hometown;
|
||||
}
|
||||
|
||||
public void setHometown(String hometown) {
|
||||
this.hometown = hometown;
|
||||
}
|
||||
|
||||
public String getChronic_disease() {
|
||||
return chronic_disease;
|
||||
}
|
||||
|
||||
public void setChronic_disease(String chronic_disease) {
|
||||
this.chronic_disease = chronic_disease;
|
||||
}
|
||||
|
||||
public long getBirthday() {
|
||||
return birthday;
|
||||
}
|
||||
|
||||
public void setBirthday(long birthday) {
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public String getEmr() {
|
||||
return emr;
|
||||
}
|
||||
|
||||
public void setEmr(String emr) {
|
||||
this.emr = emr;
|
||||
}
|
||||
|
||||
public long getCreate_time() {
|
||||
return create_time;
|
||||
}
|
||||
|
||||
public void setCreate_time(long create_time) {
|
||||
this.create_time = create_time;
|
||||
}
|
||||
|
||||
public long getUpdate_time() {
|
||||
return update_time;
|
||||
}
|
||||
|
||||
public void setUpdate_time(long update_time) {
|
||||
this.update_time = update_time;
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package com.exam.sb.entity;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class Person_health_805Entity {
|
||||
//id,sfz_id,height,weight,heart_rate,sbp,dbp,blood_sugar,create_time,update_time
|
||||
private String id;
|
||||
private String sfz_id;
|
||||
private int height;
|
||||
private int weight;
|
||||
private int heart_rate;
|
||||
private int sbp;
|
||||
private int dbp;
|
||||
private float blood_sugar;
|
||||
private long create_time;
|
||||
private long update_time;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSfz_id() {
|
||||
return sfz_id;
|
||||
}
|
||||
|
||||
public void setSfz_id(String sfz_id) {
|
||||
this.sfz_id = sfz_id;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public int getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(int weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public int getHeart_rate() {
|
||||
return heart_rate;
|
||||
}
|
||||
|
||||
public void setHeart_rate(int heart_rate) {
|
||||
this.heart_rate = heart_rate;
|
||||
}
|
||||
|
||||
public int getSbp() {
|
||||
return sbp;
|
||||
}
|
||||
|
||||
public void setSbp(int sbp) {
|
||||
this.sbp = sbp;
|
||||
}
|
||||
|
||||
public int getDbp() {
|
||||
return dbp;
|
||||
}
|
||||
|
||||
public void setDbp(int dbp) {
|
||||
this.dbp = dbp;
|
||||
}
|
||||
|
||||
public float getBlood_sugar() {
|
||||
return blood_sugar;
|
||||
}
|
||||
|
||||
public void setBlood_sugar(float blood_sugar) {
|
||||
this.blood_sugar = blood_sugar;
|
||||
}
|
||||
|
||||
public long getCreate_time() {
|
||||
return create_time;
|
||||
}
|
||||
|
||||
public void setCreate_time(long create_time) {
|
||||
this.create_time = create_time;
|
||||
}
|
||||
|
||||
public long getUpdate_time() {
|
||||
return update_time;
|
||||
}
|
||||
|
||||
public void setUpdate_time(long update_time) {
|
||||
this.update_time = update_time;
|
||||
}
|
||||
}
|
34
src/main/java/com/exam/sb/entity/User_70Entity.java
Normal file
34
src/main/java/com/exam/sb/entity/User_70Entity.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.exam.sb.entity;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class User_70Entity {
|
||||
private String name;
|
||||
private String address;
|
||||
private String password;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
}
|
21
src/main/java/com/exam/sb/mapper/Person_805Mapper.java
Normal file
21
src/main/java/com/exam/sb/mapper/Person_805Mapper.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.exam.sb.mapper;
|
||||
|
||||
import com.exam.sb.entity.Person_805Entity;
|
||||
import com.exam.sb.entity.Person_health_805Entity;
|
||||
import com.exam.sb.vo.PersonHealthVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface Person_805Mapper {
|
||||
Person_805Entity selectPerson_805(String sfz_id);
|
||||
int insertPerson_805(Person_805Entity person_805Entity);
|
||||
int updatePerson_805(Person_805Entity person_805Entity);
|
||||
//本来下面应写到独立的mapper文件中。为了简化写在了一起.
|
||||
int insertPerson_health_805(Person_health_805Entity person_health_805Entity);
|
||||
//视图查询
|
||||
PersonHealthVo selectPersonHealthVo(String sfz_id);
|
||||
|
||||
|
||||
}
|
15
src/main/java/com/exam/sb/mapper/User_70Mapper.java
Normal file
15
src/main/java/com/exam/sb/mapper/User_70Mapper.java
Normal file
@ -0,0 +1,15 @@
|
||||
package com.exam.sb.mapper;
|
||||
|
||||
import com.exam.sb.entity.User_70Entity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface User_70Mapper {
|
||||
User_70Entity select(String name);
|
||||
int insert(User_70Entity user_70Entity);
|
||||
int update(User_70Entity user_70Entity);
|
||||
int login(User_70Entity user_70Entity);
|
||||
|
||||
}
|
38
src/main/java/com/exam/sb/service/Person_805Service.java
Normal file
38
src/main/java/com/exam/sb/service/Person_805Service.java
Normal file
@ -0,0 +1,38 @@
|
||||
package com.exam.sb.service;
|
||||
|
||||
import com.exam.sb.entity.Person_805Entity;
|
||||
import com.exam.sb.entity.Person_health_805Entity;
|
||||
import com.exam.sb.mapper.Person_805Mapper;
|
||||
import com.exam.sb.vo.PersonHealthVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class Person_805Service {
|
||||
@Autowired
|
||||
Person_805Mapper person_805Mapper;
|
||||
public Person_805Entity selectPerson_805(String sfz_id){
|
||||
return person_805Mapper.selectPerson_805(sfz_id);
|
||||
}
|
||||
public int insertPerson_805(Person_805Entity person_805Entity){
|
||||
return person_805Mapper.insertPerson_805(person_805Entity);
|
||||
}
|
||||
public int updatePerson_805(Person_805Entity person_805Entity){
|
||||
return person_805Mapper.updatePerson_805(person_805Entity);
|
||||
}
|
||||
public int insertPerson_health_805(Person_health_805Entity person_health_805Entity){
|
||||
return person_805Mapper.insertPerson_health_805(person_health_805Entity);
|
||||
}
|
||||
public PersonHealthVo selectPersonHealthVo(String sfz_id){
|
||||
return person_805Mapper.selectPersonHealthVo(sfz_id);
|
||||
}
|
||||
|
||||
/* Person_805Entity selectPerson_805(String sfz_id);
|
||||
int insertPerson_805(Person_805Entity person_805Entity);
|
||||
int updatePerson_805(Person_805Entity person_805Entity);
|
||||
//本来下面应写到独立的mapper文件中。为了简化写在了一起.
|
||||
int insertPerson_health_805(Person_health_805Entity person_health_805Entity);
|
||||
//视图查询
|
||||
PersonHealthVo selectPersonHealthVo(String sfz_id);*/
|
||||
|
||||
}
|
25
src/main/java/com/exam/sb/service/User_70Service.java
Normal file
25
src/main/java/com/exam/sb/service/User_70Service.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.exam.sb.service;
|
||||
|
||||
import com.exam.sb.entity.User_70Entity;
|
||||
import com.exam.sb.mapper.User_70Mapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class User_70Service {
|
||||
@Autowired
|
||||
User_70Mapper user_70Mapper;
|
||||
public User_70Entity select(String name){
|
||||
return user_70Mapper.select(name);
|
||||
}
|
||||
public int insert(User_70Entity user_70Entity){
|
||||
return user_70Mapper.insert(user_70Entity);
|
||||
}
|
||||
public int update(User_70Entity user_70Entity){
|
||||
return user_70Mapper.update(user_70Entity);
|
||||
}
|
||||
public int login(User_70Entity user_70Entity){
|
||||
return user_70Mapper.login(user_70Entity);
|
||||
}
|
||||
|
||||
}
|
79
src/main/java/com/exam/sb/vo/PersonHealthVo.java
Normal file
79
src/main/java/com/exam/sb/vo/PersonHealthVo.java
Normal file
@ -0,0 +1,79 @@
|
||||
package com.exam.sb.vo;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class PersonHealthVo {
|
||||
private String sfz_id;
|
||||
private String name;
|
||||
private String gender;
|
||||
private String emr;
|
||||
private int sbp;
|
||||
private int dbp;
|
||||
private long create_time;
|
||||
private long update_time;
|
||||
|
||||
public String getSfz_id() {
|
||||
return sfz_id;
|
||||
}
|
||||
|
||||
public void setSfz_id(String sfz_id) {
|
||||
this.sfz_id = sfz_id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getEmr() {
|
||||
return emr;
|
||||
}
|
||||
|
||||
public void setEmr(String emr) {
|
||||
this.emr = emr;
|
||||
}
|
||||
|
||||
public int getSbp() {
|
||||
return sbp;
|
||||
}
|
||||
|
||||
public void setSbp(int sbp) {
|
||||
this.sbp = sbp;
|
||||
}
|
||||
|
||||
public int getDbp() {
|
||||
return dbp;
|
||||
}
|
||||
|
||||
public void setDbp(int dbp) {
|
||||
this.dbp = dbp;
|
||||
}
|
||||
|
||||
public long getCreate_time() {
|
||||
return create_time;
|
||||
}
|
||||
|
||||
public void setCreate_time(long create_time) {
|
||||
this.create_time = create_time;
|
||||
}
|
||||
|
||||
public long getUpdate_time() {
|
||||
return update_time;
|
||||
}
|
||||
|
||||
public void setUpdate_time(long update_time) {
|
||||
this.update_time = update_time;
|
||||
}
|
||||
}
|
1
src/main/resources/application.properties
Normal file
1
src/main/resources/application.properties
Normal file
@ -0,0 +1 @@
|
||||
spring.application.name=sb
|
16
src/main/resources/application.yml
Normal file
16
src/main/resources/application.yml
Normal file
@ -0,0 +1,16 @@
|
||||
server:
|
||||
port: 58356
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
username: root
|
||||
password:
|
||||
url: jdbc:mysql://localhost:3306/exam_20241226_58056?characterEncoding=utf-8&serverTimezone=UTC&useSSL=false
|
||||
|
||||
mybatis:
|
||||
mapper-locations: classpath:mapper/*Mapper.xml
|
||||
type-aliases-package: com.exam.sb
|
||||
configuration:
|
||||
#log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
29
src/main/resources/mapper/Person_805Mapper.xml
Normal file
29
src/main/resources/mapper/Person_805Mapper.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.exam.sb.mapper.Person_805Mapper">
|
||||
|
||||
<!-- 805-->
|
||||
<select id="selectPerson_805" resultType="com.exam.sb.entity.Person_805Entity">
|
||||
SELECT * FROM person_805 WHERE sfz_id=#{sfz_id};
|
||||
</select>
|
||||
|
||||
<insert id="insertPerson_805" parameterType="com.exam.sb.entity.Person_805Entity">
|
||||
INSERT INTO person_805 (id,sfz_id,name,gender,emr,create_time,update_time)VALUES(#{id},#{sfz_id},#{name},#{gender},#{emr},#{create_time},#{update_time})
|
||||
</insert>
|
||||
<!-- 编辑时不处理id与create_time-->
|
||||
<insert id="updatePerson_805" parameterType="com.exam.sb.entity.Person_805Entity">
|
||||
UPDATE person_805 SET name=#{name},gender=#{gender},emr=#{emr},update_time=#{update_time} WHERE sfz_id=#{sfz_id}
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="insertPerson_health_805" parameterType="com.exam.sb.entity.Person_health_805Entity">
|
||||
INSERT INTO person_health_805 (id,sfz_id,sbp,dbp,create_time,update_time)VALUES(#{id},#{sfz_id},#{sbp},#{dbp},#{create_time},#{update_time})
|
||||
</insert>
|
||||
|
||||
<select id="selectPersonHealthVo" resultType="com.exam.sb.vo.PersonHealthVo">
|
||||
SELECT t1.sfz_id,t1.name,t1.gender,t1.emr,t2.sbp,t2.dbp,t2.create_time,t2.update_time FROM person_805 AS t1 INNER JOIN person_health_805 AS t2 ON t1.sfz_id=t2.sfz_id WHERE t1.sfz_id=#{sfz_id} ORDER BY t2.update_time DESC LIMIT 0,1;
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
16
src/main/resources/mapper/User_70Mapper.xml
Normal file
16
src/main/resources/mapper/User_70Mapper.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.exam.sb.mapper.User_70Mapper">
|
||||
<select id="select" resultType="com.exam.sb.entity.User_70Entity">
|
||||
SELECT * FROM user_70 WHERE name=#{name}
|
||||
</select>
|
||||
<update id="update" parameterType="com.exam.sb.entity.User_70Entity">
|
||||
UPDATE user_70 set password=#{password},address=#{address} WHERE name=#{name}
|
||||
</update>
|
||||
<insert id="insert" parameterType="com.exam.sb.entity.User_70Entity">
|
||||
INSERT INTO user_70 (name,password,address)VALUES (#{name},#{password},#{address})
|
||||
</insert>
|
||||
<select id="login" parameterType="com.exam.sb.entity.User_70Entity">
|
||||
SELECT COUNT(*) as counter FROM user_70 WHERE name=#{name} AND password=#{password}
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user