-
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <!-- 配置全局属性 --> <settings> <!-- 使用jdbc的getGeneratedKeys获取数据库的自增主键值 --> <setting name="useGeneratedKeys" value="true" /> <!--使用列标签替换别名 默认:true--> <setting name="useColumnLabel" value="true"/> <!--开启驼峰命名转换:Table{create_time} -> Entity{createTime} --> <setting name="mapUnderscoreToCamelCase" value="true"/> </settings>查看全部
-
CREATE TABLE tb_area (
area_id int(2) NOT NULL auto_increment,
area_name varchar(200) NOT NULL,
priority int(2) NOT NULL DEFAULT'0',
create_time datetime DEFAULT NULL,
last_edit_time datetime DEFAULT NULL,
PRIMARY KEY(area_id),
UNIQUE KEY UK_AREA(area_name)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
查看全部 -
.container{
padding: 1rem;
font-size: 0.9rem;
line-height: 1.56rem;
}
.row{
display: flex;
align-items: center;
margin-bottom: 0.8rem;
}
.row text{
flex-grow: 1;
text-align: right;
}
.row input{
font-size: 0.7rem;
flex-grow: 3;
border: 1px solid #0099CC;
display: inline-block;
border-radius: 0.3rem;
box-shadow: 0 0 0.15rem #aaa;
padding: 0.3rem;
}
.row button{
padding: 0 2rem;
margin: 3rem 1rem;
}
查看全部 -
/* pages/list/list.wxss */
.widget {
position: relative;
margin-top: 5rpx;
margin-bottom: 5rpx;
padding-top: 10rpx;
padding-bottom: 10rpx;
padding-left: 40rpx;
padding-right: 40rpx;
border: #ddd 1px solid;
}
.container {
height: 100%;
display: table;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-top: 10rpx;
padding-bottom: 10rpx;
text-align: center;
}
.column {
width: 4rem;
display: table-cell;
}
.link-column {
width: 6rem;
display: table-cell;
}
.link {
color: blue;
display: inline-table;
}
查看全部 -
mybatis-config.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <!-- 配置全局属性 --> <settings> <!-- 使用jdbc的getGeneratedKeys获取数据库自增主键值 --> <setting name="useGeneratedKeys" value="true" /> <!-- 使用列标签替换列别名 默认:true --> <setting name="useColumnLabel" value="true" /> <!-- 开启驼峰命名转换:Table{create_time} -> Entity{createTime} --> <setting name="mapUnderscoreToCamelCase" value="true" /> </settings> </configuration>
查看全部 -
CREATE TABLE tb_area (
area_id int(2) NOT NULL auto_increment,
area_name varchar(200) NOT NULL,
priority int(2) NOT NULL DEFAULT'0',
create_time datetime DEFAULT NULL,
last_edit_time datetime DEFAULT NULL,
PRIMARY KEY(area_id),
UNIQUE KEY UK_AREA(area_name)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
查看全部 -
/* pages/operation/operation.wxss */
.container {
padding: 1rem;
font-size: 0.9rem;
line-height: 1.5rem;
}
.row {
display: flex;
align-items: center;
margin-bottom: 0.8rem;
}
.row text {
flex-grow: 1;
text-align: right;
}
.row input {
font-size: 0.7rem;
flex-grow: 3;
border: 1px solid #09c;
display: inline-block;
border-radius: 0.3rem;
box-shadow: 0 0 0.15rem #aaa;
padding: 0.3rem;
}
.row button {
padding: 0 2rem;
margin: 3rem 1rem;
}
查看全部 -
DROP TABLE IF EXISTS `tb_area`; CREATE TABLE `tb_area` ( `area_id` INT (2) NOT NULL AUTO_INCREMENT COMMENT '自增id', `area_name` VARCHAR (200) NOT NULL COMMENT '区域名称', `priority` INT (2) NOT NULL DEFAULT '0' COMMENT '优先级', `create_time` DATETIME DEFAULT NULL COMMENT '创建时间', `last_modify_time` DATETIME DEFAULT NULL COMMENT '最后修改时间', PRIMARY KEY (`area_id`), UNIQUE KEY `UK_AREA` (`area_name`) ) ENGINE = INNODB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8 ;查看全部
-
加载不出ComboPoolDataSource。maven下载没有该包。解决方法:修改settings.xml使用阿里云镜像仓库下载JAR包,并强制更新maven
查看全部 -
表的设计与创建
CREATE
TABLE
`tb_area` (
`area_id`
int
(2)
NOT
NULL
AUTO_INCREMENT,
`area_name`
varchar
(200)
NOT
NULL
,
`priority`
int
(2)
NOT
NULL
DEFAULT
'0'
,
`create_time` datetime
DEFAULT
NULL
,
`last_edit_time`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
PRIMARY
KEY
(`area_id`),
UNIQUE
KEY
`UK_AREA` (`area_name`)
) ENGINE=InnoDB AUTO_INCREMENT=4
DEFAULT
CHARSET=utf8;
查看全部 -
CREATE TABLE `tb_area` ( `area_id` int(2) NOT NULL AUTO_INCREMENT, `area_name` varchar(200) NOT NULL, `priority` int(2) NOT NULL DEFAULT '0', `create_time` datetime DEFAULT NULL, `last_edit_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`area_id`), UNIQUE KEY `UK_AREA` (`area_name`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
查看全部 -
@Bean(name = "sqlSessionFactory") public SqlSessionFactoryBean createSqlSessionFactoryBean() throws IOException { SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean(); //扫描mybatis-config.xml配置文件 sqlSessionFactoryBean.setConfigLocation(new ClassPathResource(mybatisConfigFilePath)); //读取jar文件信息 PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); //指定mapper文件的扫描路径 String packagSearchPath = PathMatchingResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + mapperPath;//读取路径 sqlSessionFactoryBean.setMapperLocations(resolver.getResources(packagSearchPath));//设置路径 //指定数据源 sqlSessionFactoryBean.setDataSource(dataSource); //指定映射实体类package的扫描路径 sqlSessionFactoryBean.setTypeAliasesPackage(entityPackage); return sqlSessionFactoryBean; }
查看全部 -
--DROP TABLE IF EXISTS `tb_area`;
CREATE TABLE `tb_area`(
`area_id` int(2) NOT NULL AUTO_INCREMENT,
`area_name` VARCHAR(200) NOT NULL,
`priority` int(2) NOT NULL DEFAULT 0,
`create_time` datetime DEFAULT NULL,
`last_edit_time` datetime DEFAULT NULL,
PRIMARY KEY(`area_id`),
UNIQUE KEY `UK_AREA` (`area_name`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
查看全部 -
creata table tb_area(
area_id int (2) not null auto_increment,
area_name varchar(200) not null,
priority int(2) not null default '0',
create_time datetime default null,
last_edit_time datetime default null,
primary key(area_id),
unique key uk_area(area_name))
engine=innoDB auto_increment=1 default charset=utf8;
查看全部 -
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <!-- 配置全局属性 --> <settings> <!--,使用jdbc的getGeneratedKeys获取数据库自增主键值--> <setting name="useGeneratedKeys" value="true"/> <!--让列支持别名.使用列标签替换列别名 默认:true--> <setting name="useColumnLabel" value="true"/> <!--开启驼峰命名转换:Table{create_time}->Entity{createTime}--> <setting name="mapUnderscoreToCamelCase" value="true"/> </settings> </configuration>
查看全部
举报