Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-store
Commits
55605e48
Commit
55605e48
authored
Jul 02, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
省市区
parent
32b049b9
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1201 additions
and
0 deletions
+1201
-0
CityDTO.java
gic-store-api/src/main/java/com/gic/store/dto/CityDTO.java
+88
-0
CountyDTO.java
gic-store-api/src/main/java/com/gic/store/dto/CountyDTO.java
+114
-0
ProvinceDTO.java
...tore-api/src/main/java/com/gic/store/dto/ProvinceDTO.java
+75
-0
ProvincesApiService.java
.../main/java/com/gic/store/service/ProvincesApiService.java
+16
-0
TabCityMapper.java
...src/main/java/com/gic/store/dao/mapper/TabCityMapper.java
+62
-0
TabCountyMapper.java
...c/main/java/com/gic/store/dao/mapper/TabCountyMapper.java
+58
-0
TabProvinceMapper.java
...main/java/com/gic/store/dao/mapper/TabProvinceMapper.java
+58
-0
TabCity.java
...e-service/src/main/java/com/gic/store/entity/TabCity.java
+87
-0
TabCounty.java
...service/src/main/java/com/gic/store/entity/TabCounty.java
+113
-0
TabProvince.java
...rvice/src/main/java/com/gic/store/entity/TabProvince.java
+74
-0
ProvincesService.java
...src/main/java/com/gic/store/service/ProvincesService.java
+15
-0
ProvincesServiceImpl.java
...java/com/gic/store/service/impl/ProvincesServiceImpl.java
+38
-0
ProvincesApiServiceImpl.java
.../com/gic/store/service/outer/ProvincesApiServiceImpl.java
+54
-0
TabCityMapper.xml
...store-service/src/main/resources/mapper/TabCityMapper.xml
+113
-0
TabCountyMapper.xml
...ore-service/src/main/resources/mapper/TabCountyMapper.xml
+136
-0
TabProvinceMapper.xml
...e-service/src/main/resources/mapper/TabProvinceMapper.xml
+100
-0
No files found.
gic-store-api/src/main/java/com/gic/store/dto/CityDTO.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* tab_city
*/
public
class
CityDTO
implements
Serializable
{
/**
* 城市id
*/
private
String
cityId
;
/**
* 城市名称
*/
private
String
cityName
;
/**
* 省份id
*/
private
String
provinceId
;
/**
* 城市拼音
*/
private
String
cityPy
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
public
String
getCityId
()
{
return
cityId
;
}
public
void
setCityId
(
String
cityId
)
{
this
.
cityId
=
cityId
;
}
public
String
getCityName
()
{
return
cityName
;
}
public
void
setCityName
(
String
cityName
)
{
this
.
cityName
=
cityName
;
}
public
String
getProvinceId
()
{
return
provinceId
;
}
public
void
setProvinceId
(
String
provinceId
)
{
this
.
provinceId
=
provinceId
;
}
public
String
getCityPy
()
{
return
cityPy
;
}
public
void
setCityPy
(
String
cityPy
)
{
this
.
cityPy
=
cityPy
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
\ No newline at end of file
gic-store-api/src/main/java/com/gic/store/dto/CountyDTO.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* tab_county
*/
public
class
CountyDTO
implements
Serializable
{
/**
*
*/
private
String
countyId
;
/**
*
*/
private
String
countyName
;
/**
*
*/
private
String
cityId
;
/**
*
*/
private
String
provinceId
;
/**
*
*/
private
String
fullName
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
/**
* 拼音
*/
private
String
countyPy
;
public
String
getCountyId
()
{
return
countyId
;
}
public
void
setCountyId
(
String
countyId
)
{
this
.
countyId
=
countyId
;
}
public
String
getCountyName
()
{
return
countyName
;
}
public
void
setCountyName
(
String
countyName
)
{
this
.
countyName
=
countyName
;
}
public
String
getCityId
()
{
return
cityId
;
}
public
void
setCityId
(
String
cityId
)
{
this
.
cityId
=
cityId
;
}
public
String
getProvinceId
()
{
return
provinceId
;
}
public
void
setProvinceId
(
String
provinceId
)
{
this
.
provinceId
=
provinceId
;
}
public
String
getFullName
()
{
return
fullName
;
}
public
void
setFullName
(
String
fullName
)
{
this
.
fullName
=
fullName
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getCountyPy
()
{
return
countyPy
;
}
public
void
setCountyPy
(
String
countyPy
)
{
this
.
countyPy
=
countyPy
;
}
}
\ No newline at end of file
gic-store-api/src/main/java/com/gic/store/dto/ProvinceDTO.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* tab_province
*/
public
class
ProvinceDTO
implements
Serializable
{
/**
* 省份id
*/
private
String
provinceId
;
/**
* 省份名称
*/
private
String
provinceName
;
/**
* 省份拼音
*/
private
String
provincePy
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
public
String
getProvinceId
()
{
return
provinceId
;
}
public
void
setProvinceId
(
String
provinceId
)
{
this
.
provinceId
=
provinceId
;
}
public
String
getProvinceName
()
{
return
provinceName
;
}
public
void
setProvinceName
(
String
provinceName
)
{
this
.
provinceName
=
provinceName
;
}
public
String
getProvincePy
()
{
return
provincePy
;
}
public
void
setProvincePy
(
String
provincePy
)
{
this
.
provincePy
=
provincePy
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
\ No newline at end of file
gic-store-api/src/main/java/com/gic/store/service/ProvincesApiService.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
service
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.store.dto.CityDTO
;
import
com.gic.store.dto.CountyDTO
;
import
com.gic.store.dto.ProvinceDTO
;
import
java.util.List
;
public
interface
ProvincesApiService
{
ServiceResponse
<
List
<
ProvinceDTO
>>
selectAllProvince
();
ServiceResponse
<
List
<
CityDTO
>>
selectAllCity
();
ServiceResponse
<
List
<
CountyDTO
>>
selectAllCounty
();
}
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabCityMapper.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
dao
.
mapper
;
import
com.gic.store.entity.TabCity
;
import
java.util.List
;
public
interface
TabCityMapper
{
/**
* 根据主键删除
*
* @param cityId 主键
* @return 更新条目数
*/
int
deleteByPrimaryKey
(
String
cityId
);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insert
(
TabCity
record
);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insertSelective
(
TabCity
record
);
/**
* 根据主键查询
*
* @param cityId 主键
* @return 实体对象
*/
TabCity
selectByPrimaryKey
(
String
cityId
);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKeySelective
(
TabCity
record
);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabCity
record
);
/**
* 查询所有城市
* @return
*/
List
<
TabCity
>
selectAllCity
();
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabCountyMapper.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
dao
.
mapper
;
import
com.gic.store.entity.TabCounty
;
import
java.util.List
;
public
interface
TabCountyMapper
{
/**
* 根据主键删除
*
* @param countyId 主键
* @return 更新条目数
*/
int
deleteByPrimaryKey
(
String
countyId
);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insert
(
TabCounty
record
);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insertSelective
(
TabCounty
record
);
/**
* 根据主键查询
*
* @param countyId 主键
* @return 实体对象
*/
TabCounty
selectByPrimaryKey
(
String
countyId
);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKeySelective
(
TabCounty
record
);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabCounty
record
);
List
<
TabCounty
>
selectAllCounty
();
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabProvinceMapper.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
dao
.
mapper
;
import
com.gic.store.entity.TabProvince
;
import
java.util.List
;
public
interface
TabProvinceMapper
{
/**
* 根据主键删除
*
* @param provinceId 主键
* @return 更新条目数
*/
int
deleteByPrimaryKey
(
String
provinceId
);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insert
(
TabProvince
record
);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insertSelective
(
TabProvince
record
);
/**
* 根据主键查询
*
* @param provinceId 主键
* @return 实体对象
*/
TabProvince
selectByPrimaryKey
(
String
provinceId
);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKeySelective
(
TabProvince
record
);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
updateByPrimaryKey
(
TabProvince
record
);
List
<
TabProvince
>
selectAllProvince
();
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/entity/TabCity.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
entity
;
import
java.util.Date
;
/**
* tab_city
*/
public
class
TabCity
{
/**
* 城市id
*/
private
String
cityId
;
/**
* 城市名称
*/
private
String
cityName
;
/**
* 省份id
*/
private
String
provinceId
;
/**
* 城市拼音
*/
private
String
cityPy
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
public
String
getCityId
()
{
return
cityId
;
}
public
void
setCityId
(
String
cityId
)
{
this
.
cityId
=
cityId
;
}
public
String
getCityName
()
{
return
cityName
;
}
public
void
setCityName
(
String
cityName
)
{
this
.
cityName
=
cityName
;
}
public
String
getProvinceId
()
{
return
provinceId
;
}
public
void
setProvinceId
(
String
provinceId
)
{
this
.
provinceId
=
provinceId
;
}
public
String
getCityPy
()
{
return
cityPy
;
}
public
void
setCityPy
(
String
cityPy
)
{
this
.
cityPy
=
cityPy
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/entity/TabCounty.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
entity
;
import
java.util.Date
;
/**
* tab_county
*/
public
class
TabCounty
{
/**
*
*/
private
String
countyId
;
/**
*
*/
private
String
countyName
;
/**
*
*/
private
String
cityId
;
/**
*
*/
private
String
provinceId
;
/**
*
*/
private
String
fullName
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
/**
* 拼音
*/
private
String
countyPy
;
public
String
getCountyId
()
{
return
countyId
;
}
public
void
setCountyId
(
String
countyId
)
{
this
.
countyId
=
countyId
;
}
public
String
getCountyName
()
{
return
countyName
;
}
public
void
setCountyName
(
String
countyName
)
{
this
.
countyName
=
countyName
;
}
public
String
getCityId
()
{
return
cityId
;
}
public
void
setCityId
(
String
cityId
)
{
this
.
cityId
=
cityId
;
}
public
String
getProvinceId
()
{
return
provinceId
;
}
public
void
setProvinceId
(
String
provinceId
)
{
this
.
provinceId
=
provinceId
;
}
public
String
getFullName
()
{
return
fullName
;
}
public
void
setFullName
(
String
fullName
)
{
this
.
fullName
=
fullName
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getCountyPy
()
{
return
countyPy
;
}
public
void
setCountyPy
(
String
countyPy
)
{
this
.
countyPy
=
countyPy
;
}
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/entity/TabProvince.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
entity
;
import
java.util.Date
;
/**
* tab_province
*/
public
class
TabProvince
{
/**
* 省份id
*/
private
String
provinceId
;
/**
* 省份名称
*/
private
String
provinceName
;
/**
* 省份拼音
*/
private
String
provincePy
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
public
String
getProvinceId
()
{
return
provinceId
;
}
public
void
setProvinceId
(
String
provinceId
)
{
this
.
provinceId
=
provinceId
;
}
public
String
getProvinceName
()
{
return
provinceName
;
}
public
void
setProvinceName
(
String
provinceName
)
{
this
.
provinceName
=
provinceName
;
}
public
String
getProvincePy
()
{
return
provincePy
;
}
public
void
setProvincePy
(
String
provincePy
)
{
this
.
provincePy
=
provincePy
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/service/ProvincesService.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
service
;
import
com.gic.store.entity.TabCity
;
import
com.gic.store.entity.TabCounty
;
import
com.gic.store.entity.TabProvince
;
import
java.util.List
;
public
interface
ProvincesService
{
List
<
TabProvince
>
selectAllProvince
();
List
<
TabCity
>
selectAllCity
();
List
<
TabCounty
>
selectAllCounty
();
}
gic-store-service/src/main/java/com/gic/store/service/impl/ProvincesServiceImpl.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
service
.
impl
;
import
com.gic.store.dao.mapper.TabCityMapper
;
import
com.gic.store.dao.mapper.TabCountyMapper
;
import
com.gic.store.dao.mapper.TabProvinceMapper
;
import
com.gic.store.entity.TabCity
;
import
com.gic.store.entity.TabCounty
;
import
com.gic.store.entity.TabProvince
;
import
com.gic.store.service.ProvincesService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
(
"provincesService"
)
public
class
ProvincesServiceImpl
implements
ProvincesService
{
@Autowired
private
TabProvinceMapper
tabProvinceMapper
;
@Autowired
private
TabCityMapper
tabCityMapper
;
@Autowired
private
TabCountyMapper
tabCountyMapper
;
@Override
public
List
<
TabProvince
>
selectAllProvince
()
{
return
this
.
tabProvinceMapper
.
selectAllProvince
();
}
@Override
public
List
<
TabCity
>
selectAllCity
()
{
return
this
.
tabCityMapper
.
selectAllCity
();
}
@Override
public
List
<
TabCounty
>
selectAllCounty
()
{
return
this
.
tabCountyMapper
.
selectAllCounty
();
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/ProvincesApiServiceImpl.java
0 → 100644
View file @
55605e48
package
com
.
gic
.
store
.
service
.
outer
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.store.dto.CityDTO
;
import
com.gic.store.dto.CountyDTO
;
import
com.gic.store.dto.ProvinceDTO
;
import
com.gic.store.service.ProvincesApiService
;
import
com.gic.store.service.ProvincesService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
@Service
(
"provincesApiService"
)
public
class
ProvincesApiServiceImpl
implements
ProvincesApiService
{
@Autowired
private
ProvincesService
provincesService
;
@Override
public
ServiceResponse
<
List
<
ProvinceDTO
>>
selectAllProvince
()
{
String
key
=
"enterprise:province"
;
List
<
ProvinceDTO
>
list
=
(
List
<
ProvinceDTO
>)
RedisUtil
.
getCache
(
key
);
if
(
list
==
null
){
list
=
EntityUtil
.
changeEntityListByJSON
(
ProvinceDTO
.
class
,
this
.
provincesService
.
selectAllProvince
());
RedisUtil
.
setCache
(
key
,
list
,
6
*
30
l
,
TimeUnit
.
DAYS
);
}
return
ServiceResponse
.
success
(
list
);
}
@Override
public
ServiceResponse
<
List
<
CityDTO
>>
selectAllCity
()
{
String
key
=
"enterprise:city"
;
List
<
CityDTO
>
list
=
(
List
<
CityDTO
>)
RedisUtil
.
getCache
(
key
);
if
(
list
==
null
){
list
=
EntityUtil
.
changeEntityListByJSON
(
CityDTO
.
class
,
this
.
provincesService
.
selectAllCity
());
RedisUtil
.
setCache
(
key
,
list
,
6
*
30
l
,
TimeUnit
.
DAYS
);
}
return
ServiceResponse
.
success
(
list
);
}
@Override
public
ServiceResponse
<
List
<
CountyDTO
>>
selectAllCounty
()
{
String
key
=
"enterprise:county"
;
List
<
CountyDTO
>
list
=
(
List
<
CountyDTO
>)
RedisUtil
.
getCache
(
key
);
if
(
list
==
null
){
list
=
EntityUtil
.
changeEntityListByJSON
(
CountyDTO
.
class
,
this
.
provincesService
.
selectAllCounty
());
RedisUtil
.
setCache
(
key
,
list
,
6
*
30
l
,
TimeUnit
.
DAYS
);
}
return
ServiceResponse
.
success
(
list
);
}
}
gic-store-service/src/main/resources/mapper/TabCityMapper.xml
0 → 100644
View file @
55605e48
<?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.store.dao.mapper.TabCityMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.store.entity.TabCity"
>
<id
column=
"city_id"
jdbcType=
"VARCHAR"
property=
"cityId"
/>
<result
column=
"city_name"
jdbcType=
"VARCHAR"
property=
"cityName"
/>
<result
column=
"province_id"
jdbcType=
"VARCHAR"
property=
"provinceId"
/>
<result
column=
"city_py"
jdbcType=
"VARCHAR"
property=
"cityPy"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
city_id, city_name, province_id, city_py, create_time, update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_city
where city_id = #{cityId,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from tab_city
where city_id = #{cityId,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.store.entity.TabCity"
>
insert into tab_city (city_id, city_name, province_id,
city_py, create_time, update_time
)
values (#{cityId,jdbcType=VARCHAR}, #{cityName,jdbcType=VARCHAR}, #{provinceId,jdbcType=VARCHAR},
#{cityPy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.store.entity.TabCity"
>
insert into tab_city
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"cityId != null"
>
city_id,
</if>
<if
test=
"cityName != null"
>
city_name,
</if>
<if
test=
"provinceId != null"
>
province_id,
</if>
<if
test=
"cityPy != null"
>
city_py,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"cityId != null"
>
#{cityId,jdbcType=VARCHAR},
</if>
<if
test=
"cityName != null"
>
#{cityName,jdbcType=VARCHAR},
</if>
<if
test=
"provinceId != null"
>
#{provinceId,jdbcType=VARCHAR},
</if>
<if
test=
"cityPy != null"
>
#{cityPy,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.store.entity.TabCity"
>
update tab_city
<set>
<if
test=
"cityName != null"
>
city_name = #{cityName,jdbcType=VARCHAR},
</if>
<if
test=
"provinceId != null"
>
province_id = #{provinceId,jdbcType=VARCHAR},
</if>
<if
test=
"cityPy != null"
>
city_py = #{cityPy,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where city_id = #{cityId,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.store.entity.TabCity"
>
update tab_city
set city_name = #{cityName,jdbcType=VARCHAR},
province_id = #{provinceId,jdbcType=VARCHAR},
city_py = #{cityPy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where city_id = #{cityId,jdbcType=VARCHAR}
</update>
<select
id=
"selectAllCity"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_city
</select>
</mapper>
\ No newline at end of file
gic-store-service/src/main/resources/mapper/TabCountyMapper.xml
0 → 100644
View file @
55605e48
<?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.store.dao.mapper.TabCountyMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.store.entity.TabCounty"
>
<id
column=
"county_id"
jdbcType=
"VARCHAR"
property=
"countyId"
/>
<result
column=
"county_name"
jdbcType=
"VARCHAR"
property=
"countyName"
/>
<result
column=
"city_id"
jdbcType=
"VARCHAR"
property=
"cityId"
/>
<result
column=
"province_id"
jdbcType=
"VARCHAR"
property=
"provinceId"
/>
<result
column=
"full_name"
jdbcType=
"VARCHAR"
property=
"fullName"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"county_py"
jdbcType=
"VARCHAR"
property=
"countyPy"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
county_id, county_name, city_id, province_id, full_name, create_time, update_time,
county_py
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_county
where county_id = #{countyId,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from tab_county
where county_id = #{countyId,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.store.entity.TabCounty"
>
insert into tab_county (county_id, county_name, city_id,
province_id, full_name, create_time,
update_time, county_py)
values (#{countyId,jdbcType=VARCHAR}, #{countyName,jdbcType=VARCHAR}, #{cityId,jdbcType=VARCHAR},
#{provinceId,jdbcType=VARCHAR}, #{fullName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{countyPy,jdbcType=VARCHAR})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.store.entity.TabCounty"
>
insert into tab_county
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"countyId != null"
>
county_id,
</if>
<if
test=
"countyName != null"
>
county_name,
</if>
<if
test=
"cityId != null"
>
city_id,
</if>
<if
test=
"provinceId != null"
>
province_id,
</if>
<if
test=
"fullName != null"
>
full_name,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"countyPy != null"
>
county_py,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"countyId != null"
>
#{countyId,jdbcType=VARCHAR},
</if>
<if
test=
"countyName != null"
>
#{countyName,jdbcType=VARCHAR},
</if>
<if
test=
"cityId != null"
>
#{cityId,jdbcType=VARCHAR},
</if>
<if
test=
"provinceId != null"
>
#{provinceId,jdbcType=VARCHAR},
</if>
<if
test=
"fullName != null"
>
#{fullName,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"countyPy != null"
>
#{countyPy,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.store.entity.TabCounty"
>
update tab_county
<set>
<if
test=
"countyName != null"
>
county_name = #{countyName,jdbcType=VARCHAR},
</if>
<if
test=
"cityId != null"
>
city_id = #{cityId,jdbcType=VARCHAR},
</if>
<if
test=
"provinceId != null"
>
province_id = #{provinceId,jdbcType=VARCHAR},
</if>
<if
test=
"fullName != null"
>
full_name = #{fullName,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"countyPy != null"
>
county_py = #{countyPy,jdbcType=VARCHAR},
</if>
</set>
where county_id = #{countyId,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.store.entity.TabCounty"
>
update tab_county
set county_name = #{countyName,jdbcType=VARCHAR},
city_id = #{cityId,jdbcType=VARCHAR},
province_id = #{provinceId,jdbcType=VARCHAR},
full_name = #{fullName,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
county_py = #{countyPy,jdbcType=VARCHAR}
where county_id = #{countyId,jdbcType=VARCHAR}
</update>
<select
id=
"selectAllCounty"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_county
</select>
</mapper>
\ No newline at end of file
gic-store-service/src/main/resources/mapper/TabProvinceMapper.xml
0 → 100644
View file @
55605e48
<?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.store.dao.mapper.TabProvinceMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.store.entity.TabProvince"
>
<id
column=
"province_id"
jdbcType=
"VARCHAR"
property=
"provinceId"
/>
<result
column=
"province_name"
jdbcType=
"VARCHAR"
property=
"provinceName"
/>
<result
column=
"province_py"
jdbcType=
"VARCHAR"
property=
"provincePy"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
province_id, province_name, province_py, create_time, update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_province
where province_id = #{provinceId,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from tab_province
where province_id = #{provinceId,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.store.entity.TabProvince"
>
insert into tab_province (province_id, province_name, province_py,
create_time, update_time)
values (#{provinceId,jdbcType=VARCHAR}, #{provinceName,jdbcType=VARCHAR}, #{provincePy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.store.entity.TabProvince"
>
insert into tab_province
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"provinceId != null"
>
province_id,
</if>
<if
test=
"provinceName != null"
>
province_name,
</if>
<if
test=
"provincePy != null"
>
province_py,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"provinceId != null"
>
#{provinceId,jdbcType=VARCHAR},
</if>
<if
test=
"provinceName != null"
>
#{provinceName,jdbcType=VARCHAR},
</if>
<if
test=
"provincePy != null"
>
#{provincePy,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.store.entity.TabProvince"
>
update tab_province
<set>
<if
test=
"provinceName != null"
>
province_name = #{provinceName,jdbcType=VARCHAR},
</if>
<if
test=
"provincePy != null"
>
province_py = #{provincePy,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where province_id = #{provinceId,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.store.entity.TabProvince"
>
update tab_province
set province_name = #{provinceName,jdbcType=VARCHAR},
province_py = #{provincePy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where province_id = #{provinceId,jdbcType=VARCHAR}
</update>
<select
id=
"selectAllProvince"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_province
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment