addCriterion(“id >=”, value, “id”);
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion(“id <”, value, “id”);
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion(“id <=”, value, “id”);
return (Criteria) this;
}
public Criteria andIdIn(List values) {
addCriterion(“id in”, values, “id”);
return (Criteria) this;
}
public Criteria andIdNotIn(List values) {
addCriterion(“id not in”, values, “id”);
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion(“id between”, value1, value2, “id”);
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion(“id not between”, value1, value2, “id”);
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion(“NAME is null”);
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion(“NAME is not null”);
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion(“NAME =”, value, “name”);
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion(“NAME <>”, value, “name”);
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion(“NAME >”, value, “name”);
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion(“NAME >=”, value, “name”);
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion(“NAME <”, value, “name”);
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion(“NAME <=”, value, “name”);
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion(“NAME like”, value, “name”);
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion(“NAME not like”, value, “name”);
return (Criteria) this;
}
public Criteria andNameIn(List values) {
addCriterion(“NAME in”, values, “name”);
return (Criteria) this;
}
public Criteria andNameNotIn(List values) {
addCriterion(“NAME not in”, values, “name”);
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion(“NAME between”, value1, value2, “name”);
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion(“NAME not between”, value1, value2, “name”);
return (Criteria) this;
}
public Criteria andSexIsNull() {
addCriterion(“sex is null”);
return (Criteria) this;
}
public Criteria andSexIsNotNull() {
addCriterion(“sex is not null”);
return (Criteria) this;
}
public Criteria andSexEqualTo(String value) {
addCriterion(“sex =”, value, “sex”);
return (Criteria) this;
}
public Criteria andSexNotEqualTo(String value) {
addCriterion(“sex <>”, value, “sex”);
return (Criteria) this;
}
public Criteria andSexGreaterThan(String value) {
addCriterion(“sex >”, value, “sex”);
return (Criteria) this;
}
public Criteria andSexGreaterThanOrEqualTo(String value) {
addCriterion(“sex >=”, value, “sex”);
return (Criteria) this;
}
public Criteria andSexLessThan(String value) {
addCriterion(“sex <”, value, “sex”);
return (Criteria) this;
}
public Criteria andSexLessThanOrEqualTo(String value) {
addCriterion(“sex <=”, value, “sex”);
return (Criteria) this;
}
public Criteria andSexLike(String value) {
addCriterion(“sex like”, value, “sex”);
return (Criteria) this;
}
public Criteria andSexNotLike(String value) {
addCriterion(“sex not like”, value, “sex”);
return (Criteria) this;
}
public Criteria andSexIn(List values) {
addCriterion(“sex in”, values, “sex”);
return (Criteria) this;
}
public Criteria andSexNotIn(List values) {
addCriterion(“sex not in”, values, “sex”);
return (Criteria) this;
}
public Criteria andSexBetween(String value1, String value2) {
addCriterion(“sex between”, value1, value2, “sex”);
return (Criteria) this;
}
public Criteria andSexNotBetween(String value1, String value2) {
addCriterion(“sex not between”, value1, value2, “sex”);
return (Criteria) this;
}
public Criteria andAgeIsNull() {
addCriterion(“age is null”);
return (Criteria) this;
}
public Criteria andAgeIsNotNull() {
addCriterion(“age is not null”);
return (Criteria) this;
}
public Criteria andAgeEqualTo(String value) {
addCriterion(“age =”, value, “age”);
return (Criteria) this;
}
public Criteria andAgeNotEqualTo(String value) {
addCriterion(“age <>”, value, “age”);
return (Criteria) this;
}
public Criteria andAgeGreaterThan(String value) {
addCriterion(“age >”, value, “age”);
return (Criteria) this;
}
public Criteria andAgeGreaterThanOrEqualTo(String value) {
addCriterion(“age >=”, value, “age”);
return (Criteria) this;
}
public Criteria andAgeLessThan(String value) {
addCriterion(“age <”, value, “age”);
return (Criteria) this;
}
public Criteria andAgeLessThanOrEqualTo(String value) {
addCriterion(“age <=”, value, “age”);
return (Criteria) this;
}
public Criteria andAgeLike(String value) {
addCriterion(“age like”, value, “age”);
return (Criteria) this;
}
public Criteria andAgeNotLike(String value) {
addCriterion(“age not like”, value, “age”);
return (Criteria) this;
}
public Criteria andAgeIn(List values) {
addCriterion(“age in”, values, “age”);
return (Criteria) this;
}
public Criteria andAgeNotIn(List values) {
addCriterion(“age not in”, values, “age”);
return (Criteria) this;
}
public Criteria andAgeBetween(String value1, String value2) {
addCriterion(“age between”, value1, value2, “age”);
return (Criteria) this;
}
public Criteria andAgeNotBetween(String value1, String value2) {
addCriterion(“age not between”, value1, value2, “age”);
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
package com.sx.kak.mapper;
import com.sx.kak.po.Student;
import com.sx.kak.po.StudentExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface StudentMapper {
int countByExample(StudentExample example);
int deleteByExample(StudentExample example);
int deleteByPrimaryKey(Integer id);
int insert(Student record);
int insertSelective(Student record);
List selectByExample(StudentExample example);
Student selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param(“record”) Student record, @Param(“example”) StudentExample example);
int updateByExample(@Param(“record”) Student record, @Param(“example”) StudentExample example);
int updateByPrimaryKeySelective(Student record);
int updateByPrimaryKey(Student record);
}
<?xml version="1.0" encoding="UTF-8" ?>
and ${criterion.condition}
and ${criterion.condition} #{criterion.value}
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
and ${criterion.condition}
#{listItem}
and ${criterion.condition}
and ${criterion.condition} #{criterion.value}
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
and ${criterion.condition}
#{listItem}
id, NAME, sex, age
select
distinct
from student
order by ${orderByClause}
select
from student
where id = #{id,jdbcType=INTEGER}
delete from student
where id = #{id,jdbcType=INTEGER}
delete from student
insert into student (id, NAME, sex,
age)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR},
#{age,jdbcType=VARCHAR})
insert into student
id,
NAME,
sex,
age,
#{id,jdbcType=INTEGER},
#{name,jdbcType=VARCHAR},
#{sex,jdbcType=VARCHAR},
#{age,jdbcType=VARCHAR},
select count(*) from student
update student
id = #{record.id,jdbcType=INTEGER},
NAME = #{record.name,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=VARCHAR},
age = #{record.age,jdbcType=VARCHAR},
update student
set id = #{record.id,jdbcType=INTEGER},
NAME = #{record.name,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=VARCHAR},
age = #{record.age,jdbcType=VARCHAR}
update student
NAME = #{name,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR},
age = #{age,jdbcType=VARCHAR},
where id = #{id,jdbcType=INTEGER}
update student
set NAME = #{name,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR},
age = #{age,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
server:
port: 8080
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/db0711?characterEncoding=utf8&serverTimezone=UTC
username: root
password: root
mybatis:
type-aliases-package: po
mapper-locations: classpath:mapping/*.xml
package com.sx.kak.utils;
import java.util.List;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
public class JsonUtils {
// 定义jackson对象
private static final ObjectMapper MAPPER = new ObjectMapper();
/**
-
将对象转换成json字符串。
-
Title: pojoToJson
-
Description:
-
@param data
-
@return
*/
public static String objectToJson(Object data) {
try {
String string = MAPPER.writeValueAsString(data);
return string;
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return null;
}
/**
-
将json结果集转化为对象
-
@param jsonData json数据
-
@param clazz 对象中的object类型
-
@return
*/
public static T jsonToPojo(String jsonData, Class beanType) {
try {
T t = MAPPER.readValue(jsonData, beanType);
return t;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
-
将json数据转换成pojo对象list
-
Title: jsonToList
-
Description:
-
@param jsonData
-
@param beanType
-
@return
*/
public static List jsonToList(String jsonData, Class beanType) {
JavaType javaType = MAPPER.getTypeFactory().constructParametricType(List.class, beanType);
try {
List list = MAPPER.readValue(jsonData, javaType);
return list;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
package com.sx.kak.utils;
/**
- Created by Kak on 2020/9/17.
*/
public interface RedisUtils {
public void hset(String key,String filed,String value);
public String hget(String key,String field );
public void set(String key ,String value);
public String get (String key);
public void expire(String key,int seconds);
public long ttl(String key);
}
package com.sx.kak.utils;
import redis.clients.jedis.Jedis;
/**
- Created by Kak on 2020/9/17.
*/
public class SingleTonRedisUtil implements RedisUtils{
private Jedis jedis;
public SingleTonRedisUtil(Jedis jedis){
this.jedis = jedis;
}
@Override
public void hset(String key, String filed, String value) {
jedis.hset(key, filed, value);
}
@Override
public String hget(String key, String field) {
return jedis.hget(key, field);
}
}
package com.sx.kak.config;
import com.sx.kak.utils.SingleTonRedisUtil;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.Jedis;
/**
- Created by Kak on 2020/9/17.
*/
@Configuration
public class RedisConfig {
@Bean
public SingleTonRedisUtil singleTonRedisUtil(@Qualifier(“jedis”) Jedis jedis){
SingleTonRedisUtil singleTonRedisUtil = new SingleTonRedisUtil(jedis);
return singleTonRedisUtil;
}
@Bean(name = “jedis”)
public Jedis getJedis(){
Jedis jedis = new Jedis(“127.0.0.1”,6379);
return jedis;
}
}
package com.sx.kak.service;
import com.sx.kak.po.Student;
import java.util.List;
/**
- Created by Kak on 2020/9/17.
*/
public interface StudentService {
public List findAllStudent();
}
2.11 配置StudentServiceImpl.java
package com.sx.kak.service.serviceImpl;
import com.sx.kak.mapper.StudentMapper;
import com.sx.kak.po.Student;
import com.sx.kak.po.StudentExample;
import com.sx.kak.service.StudentService;
import com.sx.kak.utils.JsonUtils;
import com.sx.kak.utils.SingleTonRedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
- Created by Kak on 2020/9/17.
*/
@Service
@Slf4j
public class StudentServiceImpl implements StudentService {
@Autowired(required = false)
private StudentMapper studentMapper;
//注入自定义的redis工具
@Autowired
private SingleTonRedisUtil redisUtil;
@Override
public List findAllStudent() {
//获取redis中存出的json字符串
String student = redisUtil.hget(“student”, “0”);
if(student!=null){
log.info(“get student from redis”);
//json对象,封装的对象类型
List students = JsonUtils.jsonToList(student, Student.class);
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数同学面临毕业设计项目选题时,很多人都会感到无从下手,尤其是对于计算机专业的学生来说,选择一个合适的题目尤为重要。因为毕业设计不仅是我们在大学四年学习的一个总结,更是展示自己能力的重要机会。
因此收集整理了一份《2024年计算机毕业设计项目大全》,初衷也很简单,就是希望能够帮助提高效率,同时减轻大家的负担。
既有Java、Web、PHP、也有C、小程序、Python等项目供你选择,真正体系化!
由于项目比较多,这里只是将部分目录截图出来,每个节点里面都包含素材文档、项目源码、讲解视频
如果你觉得这些内容对你有帮助,可以添加VX:vip1024c (备注项目大全获取)
package com.sx.kak.service.serviceImpl;
import com.sx.kak.mapper.StudentMapper;
import com.sx.kak.po.Student;
import com.sx.kak.po.StudentExample;
import com.sx.kak.service.StudentService;
import com.sx.kak.utils.JsonUtils;
import com.sx.kak.utils.SingleTonRedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
- Created by Kak on 2020/9/17.
*/
@Service
@Slf4j
public class StudentServiceImpl implements StudentService {
@Autowired(required = false)
private StudentMapper studentMapper;
//注入自定义的redis工具
@Autowired
private SingleTonRedisUtil redisUtil;
@Override
public List findAllStudent() {
//获取redis中存出的json字符串
String student = redisUtil.hget(“student”, “0”);
if(student!=null){
log.info(“get student from redis”);
//json对象,封装的对象类型
List students = JsonUtils.jsonToList(student, Student.class);
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数同学面临毕业设计项目选题时,很多人都会感到无从下手,尤其是对于计算机专业的学生来说,选择一个合适的题目尤为重要。因为毕业设计不仅是我们在大学四年学习的一个总结,更是展示自己能力的重要机会。
因此收集整理了一份《2024年计算机毕业设计项目大全》,初衷也很简单,就是希望能够帮助提高效率,同时减轻大家的负担。
[外链图片转存中…(img-J6bCHUBT-1712532616121)]
[外链图片转存中…(img-adfkLQM9-1712532616121)]
[外链图片转存中…(img-P4r8kqIv-1712532616122)]
既有Java、Web、PHP、也有C、小程序、Python等项目供你选择,真正体系化!
由于项目比较多,这里只是将部分目录截图出来,每个节点里面都包含素材文档、项目源码、讲解视频
如果你觉得这些内容对你有帮助,可以添加VX:vip1024c (备注项目大全获取)
[外链图片转存中…(img-uMXyT6hu-1712532616122)]