Commit 8e4b704c by jinxin

Merge remote-tracking branch 'origin/developer' into developer

parents 71600b14 80b63616
package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.service.entity.Test;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface TestMapper {
/**
*/
int deleteByPrimaryKey(String id);
/**
*/
int insert(Test record);
/**
*/
int insertSelective(Test record);
/**
*/
Test selectByPrimaryKey(String id);
/**
*/
int updateByPrimaryKeySelective(Test record);
/**
*/
int updateByPrimaryKey(Test record);
/**
* 查询
*
* @return
*/
List<Test> queryList();
}
\ No newline at end of file
package com.gic.haoban.manage.service.entity;
import java.io.Serializable;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
*
* @author fdh
*/
public class Test implements Serializable {
/**
*
*/
private String id;
/**
*
*/
private String name;
/**
*/
private static final long serialVersionUID = 1L;
/**
* This method returns the value of the database column test.id
*
* @return the value of test.id
*/
public String getId() {
return id;
}
/**
* This method sets the value of the database column test.id
*
* @param id the value for test.id
*/
public void setId(String id) {
this.id = id;
}
/**
* This method returns the value of the database column test.name
*
* @return the value of test.name
*/
public String getName() {
return name;
}
/**
* This method sets the value of the database column test.name
*
* @param name the value for test.name
*/
public void setName(String name) {
this.name = name;
}
}
\ No newline at end of file
package com.gic.haoban.manage.service.service;
import com.gic.haoban.manage.service.entity.Test;
/**
* Created by tgs on 2020/2/9.
*/
public interface TestService {
public void save(Test test);
}
package com.gic.haoban.manage.service.service.impl;
import com.gic.haoban.manage.service.dao.mapper.TestMapper;
import com.gic.haoban.manage.service.entity.Test;
import com.gic.haoban.manage.service.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by tgs on 2020/2/9.
*/
@Service
public class TestApiServiceImpl implements TestService {
@Autowired
private TestMapper testMapper;
@Override
public void save(Test test) {
testMapper.insert(test);
}
}
<?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.gic.haoban.manage.service.dao.mapper.TestMapper">
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.Test">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
</resultMap>
<sql id="Base_Column_List">
id, name
</sql>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.Test" >
insert into test (id,name)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR})
</insert>
<select id="queryList" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from test
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment