Mybatis-Plus插入数据时基于注解或XML主键


废话不多说,直接撸代码:




    
        
            SELECT LAST_INSERT_ID()
        
        insert into sys_room_type (room_type_no,room_type_name,room_bed,price,remark,create_time,update_time,deleted,version,other_ext1,other_ext2)
        values(#{roomTypeNo},#{roomTypeName},#{roomBed},#{price},#{remark},#{createTime},#{updateTime},#{deleted},#{version},#{otherExt1},#{otherExt2})
    


package org.jd.data.netty.big.window.chat.frame.ui.room.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.jd.data.netty.big.window.chat.entity.SysRoomType;


/**
 * 

@Description: 房间类型信息领域模型

*

@Copyright: Copyright (c)2,023

*

@Company: 北京惠农科技有限公司

*

@Created Date :2023年03月19日

*

@version 1.0 *

@author yh19166

*/
@Mapper public interface SysRoomTypeMapper extends BaseMapper { /** * 返回主键的两种方式: 基于注解和XML文件返回主键 * @param sysRoomType * @return {@link Integer} */ @Insert("insert into sys_room_type (room_type_no,room_type_name,room_bed,price,remark,create_time,update_time,deleted,version,other_ext1,other_ext2) " + "values(#{roomTypeNo},#{roomTypeName},#{roomBed},#{price},#{remark},#{createTime},#{updateTime},#{deleted},#{version},#{otherExt1},#{otherExt2})") @Options(useGeneratedKeys = true, keyProperty = "roomTypeId", keyColumn = "room_type_id") int insertRoomTypeKP(SysRoomType sysRoomType); }

案例SQL:


SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for `sys_room_type`
-- ----------------------------
DROP TABLE IF EXISTS `sys_room_type`;
CREATE TABLE `sys_room_type` (
  `room_type_id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT '房间类型主键',
  `room_type_no` varchar(50) COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'FJ000000' COMMENT '房间编号',
  `room_type_name` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '房间类型名称',
  `room_bed` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '床位',
  `price` decimal(10,2) DEFAULT '0.00' COMMENT '浠锋牸',
  `remark` varchar(50) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注:',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `deleted` int(1) DEFAULT '0' COMMENT '逻辑删除:0--正常 1--删除',
  `version` int(11) DEFAULT '0',
  `other_ext1` varchar(50) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '拓展字段1',
  `other_ext2` varchar(50) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '拓展字段2',
  PRIMARY KEY (`room_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='房间类型表';

-- ----------------------------
-- Records of sys_room_type
-- ----------------------------
INSERT INTO `sys_room_type` VALUES ('2', '429790985075609', '标准豪发单间', 'F4-01', '10.00', '标准豪发单间', '2023-07-24 21:02:55', '2023-07-24 21:02:55', '0', '0', '预留', '');
INSERT INTO `sys_room_type` VALUES ('3', '092304638213273', '标准豪发单间', 'F4-02', '10.00', '标准豪发单间', '2023-07-24 21:04:38', '2023-07-24 21:04:38', '0', '0', '预留', '预留');
INSERT INTO `sys_room_type` VALUES ('4', '351621385748783', '标准豪发双人间', 'F4-03', '10.00', '标准豪发双人间,两大床', '2023-07-24 21:51:50', '2023-07-24 21:51:50', '0', '0', '预留', '预留');
INSERT INTO `sys_room_type` VALUES ('5', '384029952477318', '标准豪发双人间', 'F4-04', '10.00', '标准豪发双人间,两大床', '2023-07-24 21:54:07', '2023-07-24 21:54:07', '0', '0', '预留', '预留');
INSERT INTO `sys_room_type` VALUES ('6', '759474426999803', '标准豪发双人间', 'F4-05', '10.00', '标准豪发双人间,两大床', '2023-07-24 21:59:47', '2023-07-24 21:59:47', '0', '0', '预留', '预留');
INSERT INTO `sys_room_type` VALUES ('7', '931333046445479', '标准豪发双人间', 'F4-06', '10.00', '标准豪发双人间,两大床', '2023-07-24 22:06:45', '2023-07-24 22:06:45', '0', '0', '预留', '预留');
INSERT INTO `sys_room_type` VALUES ('8', '422929016929188', '总统豪发套房', 'F4-07', '10.00', '总统豪发套房', '2023-07-24 22:14:44', '2023-07-24 22:14:44', '0', '0', '预留', '预留');
INSERT INTO `sys_room_type` VALUES ('9', '792438730395284', '总统豪发套房,测试异常是否回滚', 'F4-08', '10.00', '总统豪发套房,测试异常是否回滚', '2023-07-24 22:32:19', '2023-07-24 22:32:19', '0', '0', '预留,测试异常是否回滚', '预留,测试异常是否回滚');
INSERT INTO `sys_room_type` VALUES ('10', '761832951461931', '总统豪发套房,是否返回主键', 'F4-09', '10.00', '总统豪发套房,总统豪发套房,是否返回主键', '2023-07-24 23:04:55', '2023-07-24 23:04:55', '0', '0', '预留,总统豪发套房,是否返回主键', '预留,总统豪发套房,是否返回主键');
INSERT INTO `sys_room_type` VALUES ('11', '005129924664416', '总统豪发套房,是否返回主键', 'F4-10', '10.00', '总统豪发套房,总统豪发套房,是否返回主键', '2023-07-24 23:05:55', '2023-07-24 23:05:55', '0', '0', '预留,总统豪发套房,是否返回主键', '预留,总统豪发套房,是否返回主键');
INSERT INTO `sys_room_type` VALUES ('13', '658981186976237', '总统豪发套房,是否返回主键', 'F4-25', '10.00', '总统豪发套房,总统豪发套房,是否返回主键', '2023-07-24 23:34:27', '2023-07-24 23:34:27', '0', null, '预留,总统豪发套房,是否返回主键', '预留,总统豪发套房,是否返回主键');
INSERT INTO `sys_room_type` VALUES ('14', '883524375224016', '总统豪发套房,是否返回主键', 'F4-27', '10.00', '总统豪发套房,总统豪发套房,是否返回主键', '2023-07-24 23:35:59', '2023-07-24 23:35:59', '0', null, '预留,总统豪发套房,是否返回主键', '预留,总统豪发套房,是否返回主键');
INSERT INTO `sys_room_type` VALUES ('15', '493228101396644', '总统豪发套房,是否返回主键', 'F4-28', '10.00', '总统豪发套房,总统豪发套房,是否返回主键', '2023-07-24 23:42:11', '2023-07-24 23:42:11', '0', null, '预留,总统豪发套房,是否返回主键', '预留,总统豪发套房,是否返回主键');
INSERT INTO `sys_room_type` VALUES ('16', '678026790129272', '总统豪发套房,是否返回主键', 'F4-28', '10.00', '总统豪发套房,总统豪发套房,是否返回主键', '2023-07-24 23:45:45', '2023-07-24 23:45:45', '0', null, '预留,总统豪发套房,是否返回主键', '预留,总统豪发套房,是否返回主键');

 

 


package org.jd.data.netty.big.window.chat.frame.ui.room.service.impl;


import org.apache.ibatis.session.SqlSession;
import org.jd.data.netty.big.window.chat.entity.SysRoom;
import org.jd.data.netty.big.window.chat.entity.SysRoomType;
import org.jd.data.netty.big.window.chat.frame.ui.room.mapper.SysRoomMapper;
import org.jd.data.netty.big.window.chat.frame.ui.room.mapper.SysRoomTypeMapper;
import org.jd.data.netty.big.window.chat.frame.ui.room.service.SysRoomTypeService;
import org.jd.data.netty.big.window.chat.util.ProxyDruidPoolUtil;

import java.util.Date;

/**
 * 

@Description: 房间类型信息服务实现

*

@Copyright: Copyright (c)2,023

*

@Company: 北京惠农科技有限公司

*

@Created Date :2023年03月19日

*

@version 1.0 *

@author yh19166

*/
public class SysRoomTypeServiceImpl implements SysRoomTypeService { private SysRoomTypeMapper sysRoomTypeMapper; @Override public int saveRoomTypeKp(SysRoomType sysRoomType) { SqlSession sqlSession = initSession(); try { sysRoomTypeMapper = sqlSession.getMapper(SysRoomTypeMapper.class); int result = sysRoomTypeMapper.insertRoomTypeKP(sysRoomType); sqlSession.commit(); return result; } catch (Exception e) { e.printStackTrace(); sqlSession.rollback(); return -1; } finally { ProxyDruidPoolUtil.release(sqlSession); } } }

服务接口:

package org.jd.data.netty.big.window.chat.frame.ui.room.service;


import org.jd.data.netty.big.window.chat.entity.SysRoomType;

/**
 * 

@Description: 房间类型信息服务接口

*

@Copyright: Copyright (c)2,023

*

@Company: 北京惠农科技有限公司

*

@Created Date :2023年03月19日

*

@version 1.0 *

@author yh19166

*/ public interface SysRoomTypeService{ int saveRoomType(SysRoomType sysRoomType); int saveRoomTypeKp(SysRoomType sysRoomType); }

 服务提供类:

package org.jd.data.netty.big.window.chat.frame.ui.room.provider;

import org.jd.data.netty.big.window.chat.entity.SysRoomType;
import org.jd.data.netty.big.window.chat.frame.ui.room.service.SysRoomTypeService;
import org.jd.data.netty.big.window.chat.frame.ui.room.service.impl.SysRoomTypeServiceImpl;
import org.jd.data.netty.big.window.chat.util.instance.SSOAutoServiceBean;

/**
 * 

@Description: 房间类型服务提供者

*

@Copyright: Copyright (c)2,023

*

@Company: 北京惠农科技有限公司

*

@Created Date :2023年03月19日

*

@version 1.0 *

@author yh19166

*/
public class SysRoomTypeServiceProvider { // 这里自定义注解,注解服务实现类 @SSOAutoServiceBean(value = SysRoomTypeServiceImpl.class) private SysRoomTypeService sysRoomTypeService; /** * 保存房间类型信息 * @param sysRoomType * @return {@link Integer} */ public int saveRoomType(SysRoomType sysRoomType){ return sysRoomTypeService.saveRoomType(sysRoomType); } /** * 保存房间类型信息;是否返回主键 * @param sysRoomType * @return {@link Integer} */ public int saveRoomTypePK(SysRoomType sysRoomType){ return sysRoomTypeService.saveRoomTypeKp(sysRoomType); } }


测试类:

package org.jd.data.frame.big.window.service;
import cn.hutool.core.util.RandomUtil;
import org.jd.data.netty.big.window.chat.entity.SysRoomType;
import org.jd.data.netty.big.window.chat.frame.ui.room.provider.SysRoomTypeServiceProvider;
import org.jd.data.netty.big.window.chat.util.handler.AutoInstanceFactoryHandler;
import org.junit.Test;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Optional;

public class SysRoomTypeProviderTest {

    @Test
    public void saveRoomType() {
        Optional sysRoomTypeService = AutoInstanceFactoryHandler.getBeanInstance(SysRoomTypeServiceProvider.class);
        if (sysRoomTypeService.isPresent()) {
            SysRoomTypeServiceProvider sysRoomTypeServiceProvider = sysRoomTypeService.get();
            SysRoomType sysRoomType = new SysRoomType();
            sysRoomType.setRoomTypeName("总统豪发套房,测试异常是否回滚");
            sysRoomType.setRoomBed("F4-08");
            sysRoomType.setRoomTypeNo(RandomUtil.randomNumbers(15));
            sysRoomType.setPrice(BigDecimal.TEN);
            sysRoomType.setDeleted(0);
            sysRoomType.setRemark("总统豪发套房,测试异常是否回滚");
            sysRoomType.setCreateTime(new Date());
            sysRoomType.setUpdateTime(new Date());
            sysRoomType.setOtherExt1("预留,测试异常是否回滚");
            sysRoomType.setOtherExt2("预留,测试异常是否回滚");
            int result = sysRoomTypeServiceProvider.saveRoomType(sysRoomType);
            System.out.println("是否成功: " + result);
        }
    }

    /**
     * 使用注解的方式,看看是否返回主键
     */
    @Test
    public void saveRoomTypeResultKP() {
        Optional sysRoomTypeService = AutoInstanceFactoryHandler.getBeanInstance(SysRoomTypeServiceProvider.class);
        if (sysRoomTypeService.isPresent()) {
            SysRoomTypeServiceProvider sysRoomTypeServiceProvider = sysRoomTypeService.get();
            SysRoomType sysRoomType = new SysRoomType();
            sysRoomType.setRoomTypeName("总统豪发套房,是否返回主键");
            sysRoomType.setRoomBed("F4-28");
            sysRoomType.setRoomTypeNo(RandomUtil.randomNumbers(15));
            sysRoomType.setPrice(BigDecimal.TEN);
            sysRoomType.setDeleted(0);
            sysRoomType.setRemark("总统豪发套房,总统豪发套房,是否返回主键");
            sysRoomType.setCreateTime(new Date());
            sysRoomType.setUpdateTime(new Date());
            sysRoomType.setOtherExt1("预留,总统豪发套房,是否返回主键");
            sysRoomType.setOtherExt2("预留,总统豪发套房,是否返回主键");
            int result = sysRoomTypeServiceProvider.saveRoomTypePK(sysRoomType);
            System.out.println("是否成功: " + result+"  | 主键是否返回: "+sysRoomType.getRoomTypeId());
        }
    }
}

测试结果:


"C:\Program Files\Java\jdk1.8.0_221\bin\java.exe" -javaagent:C:\Users\Administrator\AppData\Roaming\JetBrains\IntelliJIdea2020.2\plugins\MybatisLog\lib\mybatis-agent-1.0.30-all.jar -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:D:\idea_worker\IntelliJ IDEA 2020.2\lib\idea_rt.jar=62643:D:\idea_worker\IntelliJ IDEA 2020.2\bin" -Dfile.encoding=UTF-8 -classpath "D:\idea_worker\IntelliJ IDEA 2020.2\lib\idea_rt.jar;D:\idea_worker\IntelliJ IDEA 2020.2\plugins\junit\lib\junit5-rt.jar;D:\idea_worker\IntelliJ IDEA 2020.2\plugins\junit\lib\junit-rt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\rt.jar;D:\program_file\SSO-ReactiveServer-Sysetem\SSO-JRootPaneWindow-provider\target\test-classes;D:\program_file\SSO-ReactiveServer-Sysetem\SSO-JRootPaneWindow-provider\target\classes;D:\maven_worker\Respository\Respository\org\projectlombok\lombok\1.18.22\lombok-1.18.22.jar;D:\maven_worker\Respository\Respository\cn\hutool\hutool-all\5.8.18\hutool-all-5.8.18.jar;D:\maven_worker\Respository\Respository\org\ehcache\ehcache\3.10.8\ehcache-3.10.8.jar;D:\maven_worker\Respository\Respository\javax\cache\cache-api\1.1.1\cache-api-1.1.1.jar;D:\maven_worker\Respository\Respository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;D:\maven_worker\Respository\Respository\org\glassfish\jaxb\jaxb-runtime\2.3.2\jaxb-runtime-2.3.2.jar;D:\maven_worker\Respository\Respository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;D:\maven_worker\Respository\Respository\org\glassfish\jaxb\txw2\2.3.2\txw2-2.3.2.jar;D:\maven_worker\Respository\Respository\com\sun\istack\istack-commons-runtime\3.0.8\istack-commons-runtime-3.0.8.jar;D:\maven_worker\Respository\Respository\org\jvnet\staxex\stax-ex\1.8.1\stax-ex-1.8.1.jar;D:\maven_worker\Respository\Respository\com\sun\xml\fastinfoset\FastInfoset\1.2.16\FastInfoset-1.2.16.jar;D:\maven_worker\Respository\Respository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;D:\maven_worker\Respository\Respository\org\jfree\jfreechart\1.5.4\jfreechart-1.5.4.jar;D:\maven_worker\Respository\Respository\mysql\mysql-connector-java\8.0.28\mysql-connector-java-8.0.28.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus\3.5.3.1\mybatis-plus-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-extension\3.5.3.1\mybatis-plus-extension-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-core\3.5.3.1\mybatis-plus-core-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-annotation\3.5.3.1\mybatis-plus-annotation-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\github\jsqlparser\jsqlparser\4.4\jsqlparser-4.4.jar;D:\maven_worker\Respository\Respository\org\mybatis\mybatis\3.5.10\mybatis-3.5.10.jar;D:\maven_worker\Respository\Respository\org\mybatis\mybatis-spring\2.0.7\mybatis-spring-2.0.7.jar;D:\maven_worker\Respository\Respository\com\alibaba\druid\1.2.16\druid-1.2.16.jar;D:\maven_worker\Respository\Respository\org\redisson\redisson\3.23.0\redisson-3.23.0.jar;D:\maven_worker\Respository\Respository\io\netty\netty-common\4.1.48.Final\netty-common-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-codec\4.1.48.Final\netty-codec-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-buffer\4.1.48.Final\netty-buffer-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-transport\4.1.48.Final\netty-transport-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-resolver\4.1.48.Final\netty-resolver-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-resolver-dns\4.1.48.Final\netty-resolver-dns-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-codec-dns\4.1.48.Final\netty-codec-dns-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-handler\4.1.48.Final\netty-handler-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\projectreactor\reactor-core\3.3.4.RELEASE\reactor-core-3.3.4.RELEASE.jar;D:\maven_worker\Respository\Respository\org\reactivestreams\reactive-streams\1.0.3\reactive-streams-1.0.3.jar;D:\maven_worker\Respository\Respository\io\reactivex\rxjava3\rxjava\3.1.6\rxjava-3.1.6.jar;D:\maven_worker\Respository\Respository\org\jboss\marshalling\jboss-marshalling\2.0.11.Final\jboss-marshalling-2.0.11.Final.jar;D:\maven_worker\Respository\Respository\org\jboss\marshalling\jboss-marshalling-river\2.0.11.Final\jboss-marshalling-river-2.0.11.Final.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\kryo\5.5.0\kryo-5.5.0.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\reflectasm\1.11.9\reflectasm-1.11.9.jar;D:\maven_worker\Respository\Respository\org\objenesis\objenesis\3.3\objenesis-3.3.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\minlog\1.3.1\minlog-1.3.1.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-annotations\2.10.3\jackson-annotations-2.10.3.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.10.3\jackson-dataformat-yaml-2.10.3.jar;D:\maven_worker\Respository\Respository\org\yaml\snakeyaml\1.25\snakeyaml-1.25.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-core\2.10.3\jackson-core-2.10.3.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-databind\2.10.3\jackson-databind-2.10.3.jar;D:\maven_worker\Respository\Respository\net\bytebuddy\byte-buddy\1.10.8\byte-buddy-1.10.8.jar;D:\maven_worker\Respository\Respository\org\jodd\jodd-bean\5.1.6\jodd-bean-5.1.6.jar;D:\maven_worker\Respository\Respository\org\jodd\jodd-core\5.1.6\jodd-core-5.1.6.jar;D:\maven_worker\Respository\Respository\org\ini4j\ini4j\0.5.4\ini4j-0.5.4.jar;D:\maven_worker\Respository\Respository\org\springframework\spring-core\5.2.5.RELEASE\spring-core-5.2.5.RELEASE.jar;D:\maven_worker\Respository\Respository\org\springframework\spring-jcl\5.2.5.RELEASE\spring-jcl-5.2.5.RELEASE.jar;D:\maven_worker\Respository\Respository\junit\junit\4.13.2\junit-4.13.2.jar;D:\maven_worker\Respository\Respository\org\hamcrest\hamcrest-core\2.1\hamcrest-core-2.1.jar;D:\maven_worker\Respository\Respository\org\hamcrest\hamcrest\2.1\hamcrest-2.1.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 org.jd.data.frame.big.window.service.SysRoomTypeProviderTest,saveRoomTypeResultKP
Start: MyBatis Log EasyPlus
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Druid数据库连接池初始化 耗时: 0.1166735秒 | {url=jdbc:mysql://127.0.0.1:3306/tope-pay-user?useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&autoReconnect=true&failOverReadOnly=false&useSSL=false, filters=stat,wall, maxActive=50, driverClassName=com.mysql.cj.jdbc.Driver, maxWait=60000, testWhileIdle=true, minEvictableIdleTimeMillis=300000, testOnReturn=false, username=root, minIdle=1, timeBetweenEvictionRunsMillis=30000, password=123456, testOnBorrow=false, initialSize=5}
==>  SQLStructure: {"id":"org.jd.data.netty.big.window.chat.frame.ui.room.mapper.SysRoomTypeMapper.insertRoomTypeKP","originalSql":"insert into sys_room_type (room_type_no,room_type_name,room_bed,price,remark,create_time,update_time,deleted,version,other_ext1,other_ext2) values(#{roomTypeNo},#{roomTypeName},#{roomBed},#{price},#{remark},#{createTime},#{updateTime},#{deleted},#{version},#{otherExt1},#{otherExt2})","completeSql":"insert into sys_room_type (room_type_no,room_type_name,room_bed,price,remark,create_time,update_time,deleted,version,other_ext1,other_ext2) values('678026790129272','总统豪发套房,是否返回主键','F4-28',10,'总统豪发套房,总统豪发套房,是否返回主键','2023-07-24 23:45:44','2023-07-24 23:45:44',0,,'预留,总统豪发套房,是否返回主键','预留,总统豪发套房,是否返回主键')","parameter":"[{\"roomTypeNo\":\"'678026790129272'\"},{\"roomTypeName\":\"'总统豪发套房,是否返回主键'\"},{\"roomBed\":\"'F4-28'\"},{\"price\":\"10\"},{\"remark\":\"'总统豪发套房,总统豪发套房,是否返回主键'\"},{\"createTime\":\"'2023-07-24 23:45:44'\"},{\"updateTime\":\"'2023-07-24 23:45:44'\"},{\"deleted\":\"0\"},{\"version\":\"\"},{\"otherExt1\":\"'预留,总统豪发套房,是否返回主键'\"},{\"otherExt2\":\"'预留,总统豪发套房,是否返回主键'\"}]"}
是否成功: 1  | 主键是否返回: 16

Process finished with exit code 0
 

你可能感兴趣的:(mybatis,xml)