111
This commit is contained in:
parent
576c29885b
commit
81c57e91fb
@ -4,8 +4,10 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.base.vo.BaseCountryVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -28,28 +30,33 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 国家地区Controller
|
||||
*
|
||||
*
|
||||
* @author pqz
|
||||
* @date 2025-10-31
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/country")
|
||||
public class BaseCountryController extends BaseController
|
||||
{
|
||||
public class BaseCountryController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseCountryService baseCountryService;
|
||||
|
||||
/**
|
||||
* 查询国家地区列表
|
||||
*/
|
||||
* 分页查询国家和地区
|
||||
*
|
||||
* @param baseCountry TODO
|
||||
* @param pageNum TODO
|
||||
* @param pageSize TODO
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
* @author PQZ
|
||||
* @date 15:48 2025/11/17
|
||||
**/
|
||||
@PreAuthorize("@ss.hasPermi('base:country:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(BaseCountry baseCountry,
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<BaseCountry> page = new Page<>(pageNum, pageSize);
|
||||
IPage<BaseCountry> list = baseCountryService.queryListPage(baseCountry,page);
|
||||
IPage<BaseCountryVO> list = baseCountryService.queryListPage(baseCountry, page);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@ -59,8 +66,7 @@ public class BaseCountryController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('base:country:export')")
|
||||
@Log(title = "国家地区", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseCountry baseCountry)
|
||||
{
|
||||
public void export(HttpServletResponse response, BaseCountry baseCountry) {
|
||||
List<BaseCountry> list = baseCountryService.list();
|
||||
ExcelUtil<BaseCountry> util = new ExcelUtil<BaseCountry>(BaseCountry.class);
|
||||
util.exportExcel(response, list, "国家地区数据");
|
||||
@ -71,8 +77,7 @@ public class BaseCountryController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:country:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(baseCountryService.getById(id));
|
||||
}
|
||||
|
||||
@ -82,8 +87,7 @@ public class BaseCountryController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('base:country:add')")
|
||||
@Log(title = "国家地区", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseCountry baseCountry)
|
||||
{
|
||||
public AjaxResult add(@RequestBody BaseCountry baseCountry) {
|
||||
return toAjax(baseCountryService.save(baseCountry));
|
||||
}
|
||||
|
||||
@ -93,8 +97,7 @@ public class BaseCountryController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('base:country:edit')")
|
||||
@Log(title = "国家地区", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseCountry baseCountry)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody BaseCountry baseCountry) {
|
||||
return toAjax(baseCountryService.updateById(baseCountry));
|
||||
}
|
||||
|
||||
@ -103,9 +106,8 @@ public class BaseCountryController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:country:remove')")
|
||||
@Log(title = "国家地区", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
List<String> list = new ArrayList<>(Arrays.asList(ids));
|
||||
return toAjax(baseCountryService.removeByIds(list));
|
||||
}
|
||||
|
||||
@ -4,8 +4,11 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.base.vo.BaseCountryVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -28,39 +31,56 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 时区Controller
|
||||
*
|
||||
*
|
||||
* @author pqz
|
||||
* @date 2025-10-31
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/zone")
|
||||
public class BaseTimeZoneController extends BaseController
|
||||
{
|
||||
public class BaseTimeZoneController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseTimeZoneService baseTimeZoneService;
|
||||
|
||||
/**
|
||||
* 查询时区列表
|
||||
*/
|
||||
* 分页查询时区列表
|
||||
*
|
||||
* @param baseTimeZone {@link BaseTimeZone}
|
||||
* @param pageNum 分页参数
|
||||
* @param pageSize 分页参数
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
* @author PQZ
|
||||
* @date 15:44 2025/11/17
|
||||
**/
|
||||
@PreAuthorize("@ss.hasPermi('base:zone:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(BaseTimeZone baseTimeZone,
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<BaseTimeZone> page = new Page<>(pageNum, pageSize);
|
||||
IPage<BaseTimeZone> list = baseTimeZoneService.queryListPage(baseTimeZone,page);
|
||||
IPage<BaseTimeZone> list = baseTimeZoneService.queryListPage(baseTimeZone, page);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 不分页获取时区
|
||||
*
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
* @author PQZ
|
||||
* @date 15:02 2025/11/17
|
||||
**/
|
||||
@GetMapping("/listZone")
|
||||
public AjaxResult listZone() {
|
||||
return success(baseTimeZoneService.list());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出时区列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:zone:export')")
|
||||
@Log(title = "时区", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseTimeZone baseTimeZone)
|
||||
{
|
||||
public void export(HttpServletResponse response, BaseTimeZone baseTimeZone) {
|
||||
List<BaseTimeZone> list = baseTimeZoneService.list();
|
||||
ExcelUtil<BaseTimeZone> util = new ExcelUtil<BaseTimeZone>(BaseTimeZone.class);
|
||||
util.exportExcel(response, list, "时区数据");
|
||||
@ -71,8 +91,7 @@ public class BaseTimeZoneController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:zone:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(baseTimeZoneService.getById(id));
|
||||
}
|
||||
|
||||
@ -82,8 +101,7 @@ public class BaseTimeZoneController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('base:zone:add')")
|
||||
@Log(title = "时区", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseTimeZone baseTimeZone)
|
||||
{
|
||||
public AjaxResult add(@RequestBody BaseTimeZone baseTimeZone) {
|
||||
return toAjax(baseTimeZoneService.save(baseTimeZone));
|
||||
}
|
||||
|
||||
@ -93,8 +111,7 @@ public class BaseTimeZoneController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('base:zone:edit')")
|
||||
@Log(title = "时区", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseTimeZone baseTimeZone)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody BaseTimeZone baseTimeZone) {
|
||||
return toAjax(baseTimeZoneService.updateById(baseTimeZone));
|
||||
}
|
||||
|
||||
@ -103,9 +120,8 @@ public class BaseTimeZoneController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:zone:remove')")
|
||||
@Log(title = "时区", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
List<String> list = new ArrayList<>(Arrays.asList(ids));
|
||||
return toAjax(baseTimeZoneService.removeByIds(list));
|
||||
}
|
||||
|
||||
@ -15,12 +15,11 @@ import com.ruoyi.common.core.domain.DlBaseEntity;
|
||||
*/
|
||||
@TableName("base_time_zone")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BaseTimeZone extends DlBaseEntity
|
||||
public class BaseTimeZone
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@ -1,21 +1,31 @@
|
||||
package com.ruoyi.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.base.domain.BaseCountry;
|
||||
import com.ruoyi.base.vo.BaseCountryVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 国家地区Mapper接口
|
||||
*
|
||||
*
|
||||
* @author pqz
|
||||
* @date 2025-10-31
|
||||
*/
|
||||
@Mapper
|
||||
public interface BaseCountryMapper extends BaseMapper<BaseCountry>
|
||||
{
|
||||
IPage<BaseCountry> queryListPage(@Param("entity") BaseCountry entity, Page<BaseCountry> page);
|
||||
public interface BaseCountryMapper extends BaseMapper<BaseCountry> {
|
||||
/**
|
||||
* 分页查询国家和地区
|
||||
*
|
||||
* @param entity {@link BaseCountry}
|
||||
* @param page 分页参数
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.ruoyi.base.domain.BaseCountry>
|
||||
* @author PQZ
|
||||
* @date 15:46 2025/11/17
|
||||
**/
|
||||
IPage<BaseCountryVO> queryListPage(@Param("entity") BaseCountry entity, Page<BaseCountry> page);
|
||||
}
|
||||
|
||||
@ -1,21 +1,31 @@
|
||||
package com.ruoyi.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.base.domain.BaseTimeZone;
|
||||
import com.ruoyi.base.vo.BaseCountryVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 时区Mapper接口
|
||||
*
|
||||
*
|
||||
* @author pqz
|
||||
* @date 2025-10-31
|
||||
*/
|
||||
@Mapper
|
||||
public interface BaseTimeZoneMapper extends BaseMapper<BaseTimeZone>
|
||||
{
|
||||
public interface BaseTimeZoneMapper extends BaseMapper<BaseTimeZone> {
|
||||
/**
|
||||
* 分页查询时区列表
|
||||
*
|
||||
* @param entity {@link BaseTimeZone}
|
||||
* @param page 分页参数
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.ruoyi.base.vo.BaseCountryVO>
|
||||
* @author PQZ
|
||||
* @date 15:35 2025/11/17
|
||||
**/
|
||||
IPage<BaseTimeZone> queryListPage(@Param("entity") BaseTimeZone entity, Page<BaseTimeZone> page);
|
||||
}
|
||||
|
||||
@ -1,18 +1,28 @@
|
||||
package com.ruoyi.base.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.base.domain.BaseCountry;
|
||||
import com.ruoyi.base.vo.BaseCountryVO;
|
||||
|
||||
/**
|
||||
* 国家地区Service接口
|
||||
*
|
||||
*
|
||||
* @author pqz
|
||||
* @date 2025-10-31
|
||||
*/
|
||||
public interface IBaseCountryService extends IService<BaseCountry>
|
||||
{
|
||||
IPage<BaseCountry> queryListPage(BaseCountry pageReqVO, Page<BaseCountry> page);
|
||||
public interface IBaseCountryService extends IService<BaseCountry> {
|
||||
/**
|
||||
* 分页查询国际和地区
|
||||
*
|
||||
* @param pageReqVO {@link BaseCountry}
|
||||
* @param page 分页参数
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.ruoyi.base.vo.BaseCountryVO>
|
||||
* @author PQZ
|
||||
* @date 15:47 2025/11/17
|
||||
**/
|
||||
IPage<BaseCountryVO> queryListPage(BaseCountry pageReqVO, Page<BaseCountry> page);
|
||||
}
|
||||
|
||||
@ -1,18 +1,28 @@
|
||||
package com.ruoyi.base.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.base.domain.BaseTimeZone;
|
||||
import com.ruoyi.base.vo.BaseCountryVO;
|
||||
|
||||
/**
|
||||
* 时区Service接口
|
||||
*
|
||||
*
|
||||
* @author pqz
|
||||
* @date 2025-10-31
|
||||
*/
|
||||
public interface IBaseTimeZoneService extends IService<BaseTimeZone>
|
||||
{
|
||||
public interface IBaseTimeZoneService extends IService<BaseTimeZone> {
|
||||
/**
|
||||
* 分页查询时区列表
|
||||
*
|
||||
* @param pageReqVO {@link BaseTimeZone}
|
||||
* @param page 分页参数
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.ruoyi.base.vo.BaseCountryVO>
|
||||
* @author PQZ
|
||||
* @date 15:34 2025/11/17
|
||||
**/
|
||||
IPage<BaseTimeZone> queryListPage(BaseTimeZone pageReqVO, Page<BaseTimeZone> page);
|
||||
}
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package com.ruoyi.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.base.vo.BaseCountryVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -12,18 +14,26 @@ import com.ruoyi.base.service.IBaseCountryService;
|
||||
|
||||
/**
|
||||
* 国家地区Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author pqz
|
||||
* @date 2025-10-31
|
||||
*/
|
||||
@Service
|
||||
public class BaseCountryServiceImpl extends ServiceImpl<BaseCountryMapper,BaseCountry> implements IBaseCountryService
|
||||
{
|
||||
public class BaseCountryServiceImpl extends ServiceImpl<BaseCountryMapper, BaseCountry> implements IBaseCountryService {
|
||||
@Autowired
|
||||
private BaseCountryMapper baseCountryMapper;
|
||||
|
||||
/**
|
||||
* 分页查询国家和地区
|
||||
*
|
||||
* @param pageReqVO {@link BaseCountryVO}
|
||||
* @param page 分页参数
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.ruoyi.base.domain.BaseCountry>
|
||||
* @author PQZ
|
||||
* @date 15:47 2025/11/17
|
||||
**/
|
||||
@Override
|
||||
public IPage<BaseCountry> queryListPage(BaseCountry pageReqVO, Page<BaseCountry> page) {
|
||||
public IPage<BaseCountryVO> queryListPage(BaseCountry pageReqVO, Page<BaseCountry> page) {
|
||||
return baseCountryMapper.queryListPage(pageReqVO, page);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package com.ruoyi.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.base.vo.BaseCountryVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -12,16 +14,24 @@ import com.ruoyi.base.service.IBaseTimeZoneService;
|
||||
|
||||
/**
|
||||
* 时区Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author pqz
|
||||
* @date 2025-10-31
|
||||
*/
|
||||
@Service
|
||||
public class BaseTimeZoneServiceImpl extends ServiceImpl<BaseTimeZoneMapper,BaseTimeZone> implements IBaseTimeZoneService
|
||||
{
|
||||
public class BaseTimeZoneServiceImpl extends ServiceImpl<BaseTimeZoneMapper, BaseTimeZone> implements IBaseTimeZoneService {
|
||||
@Autowired
|
||||
private BaseTimeZoneMapper baseTimeZoneMapper;
|
||||
|
||||
/**
|
||||
* 分页查询时区列表
|
||||
*
|
||||
* @param pageReqVO TODO
|
||||
* @param page TODO
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.ruoyi.base.domain.BaseTimeZone>
|
||||
* @author PQZ
|
||||
* @date 15:34 2025/11/17
|
||||
**/
|
||||
@Override
|
||||
public IPage<BaseTimeZone> queryListPage(BaseTimeZone pageReqVO, Page<BaseTimeZone> page) {
|
||||
return baseTimeZoneMapper.queryListPage(pageReqVO, page);
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.base.vo;
|
||||
|
||||
import com.ruoyi.base.domain.BaseCountry;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 日历对象 base_calendar
|
||||
*
|
||||
* @author pqz
|
||||
* @date 2025-10-31
|
||||
*/
|
||||
@Data
|
||||
public class BaseCountryVO extends BaseCountry {
|
||||
/**节日*/
|
||||
String zoneName;
|
||||
|
||||
}
|
||||
@ -4,21 +4,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.base.mapper.BaseCountryMapper">
|
||||
|
||||
<resultMap type="BaseCountry" id="BaseCountryResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="nameEn" column="name_en" />
|
||||
<result property="nameCn" column="name_cn" />
|
||||
<result property="img" column="img" />
|
||||
<result property="continent" column="continent" />
|
||||
<result property="zoneId" column="zone_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseCountryVo">
|
||||
select id, name_en, name_cn, img, continent, zone_id from base_country
|
||||
</sql>
|
||||
|
||||
<select id="queryListPage" parameterType="BaseCountry" resultMap="BaseCountryResult">
|
||||
<include refid="selectBaseCountryVo"/>
|
||||
<select id="queryListPage" resultType="com.ruoyi.base.vo.BaseCountryVO">
|
||||
SELECT
|
||||
main.*,
|
||||
btz.zone_name AS zoneName
|
||||
FROM
|
||||
base_country main
|
||||
LEFT JOIN base_time_zone btz ON main.zone_id = btz.id
|
||||
<where>
|
||||
<if test="entity.nameEn != null and entity.nameEn != ''"> and name_en = #{entity.nameEn}</if>
|
||||
<if test="entity.nameCn != null and entity.nameCn != ''"> and name_cn = #{entity.nameCn}</if>
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.base.mapper.BaseTimeZoneMapper">
|
||||
|
||||
|
||||
<resultMap type="BaseTimeZone" id="BaseTimeZoneResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="zoneName" column="zone_name" />
|
||||
|
||||
@ -17,6 +17,14 @@ export function getZone(id) {
|
||||
})
|
||||
}
|
||||
|
||||
// 不分页查询时区列表
|
||||
export function zoneList() {
|
||||
return request({
|
||||
url: '/base/zone/listZone',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增时区
|
||||
export function addZone(data) {
|
||||
return request({
|
||||
|
||||
@ -34,38 +34,6 @@
|
||||
v-hasPermi="['base:country:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['base:country:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['base:country:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['base:country:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@ -79,7 +47,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="中文名称" align="center" prop="nameCn" />
|
||||
<el-table-column label="所属大洲(中文)" align="center" prop="continent" />
|
||||
<el-table-column label="所用时区" align="center" prop="zoneId" />
|
||||
<el-table-column label="所用时区" align="center" prop="zoneName" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -109,21 +77,34 @@
|
||||
|
||||
<!-- 添加或修改国家地区对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="国家名称" prop="nameEn">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="英文标准名称" prop="nameEn">
|
||||
<el-input v-model="form.nameEn" placeholder="请输入国家名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="国家名称" prop="nameCn">
|
||||
<el-form-item label="中文名称" prop="nameCn">
|
||||
<el-input v-model="form.nameCn" placeholder="请输入国家名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="国旗" prop="img">
|
||||
<el-input v-model="form.img" placeholder="请输入国旗" />
|
||||
<el-form-item label="iso两字代码" prop="isoAlphaTwo">
|
||||
<el-input v-model="form.isoAlphaTwo" placeholder="请输入国旗" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属大洲(中文)" prop="continent">
|
||||
<el-form-item label="iso三字代码" prop="isoAlphaThree">
|
||||
<el-input v-model="form.isoAlphaThree" placeholder="请输入国旗" />
|
||||
</el-form-item>
|
||||
<el-form-item label="国旗" prop="img">
|
||||
<el-input v-model="form.isoAlphaThree" placeholder="请输入国旗" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属大洲" prop="continent">
|
||||
<el-input v-model="form.continent" placeholder="请输入所属大洲(中文)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所用时区" prop="zoneId">
|
||||
<el-input v-model="form.zoneId" placeholder="请输入所用时区" />
|
||||
<el-select v-model="form.zoneId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in zones"
|
||||
:key="item.id"
|
||||
:label="item.zoneName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -136,6 +117,7 @@
|
||||
|
||||
<script>
|
||||
import { listCountry, getCountry, delCountry, addCountry, updateCountry } from "@/api/base/country";
|
||||
import { zoneList } from "@/api/base/zone";
|
||||
|
||||
export default {
|
||||
name: "Country",
|
||||
@ -170,7 +152,8 @@ export default {
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
},
|
||||
zones:[]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -204,10 +187,20 @@ export default {
|
||||
nameCn: null,
|
||||
img: null,
|
||||
continent: null,
|
||||
isoAlphaTwo:null,
|
||||
isoAlphaThree:null,
|
||||
zoneId: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
||||
/**查询时区*/
|
||||
getZoneList(){
|
||||
zoneList().then(res => {
|
||||
this.zones = res.data
|
||||
})
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
@ -228,6 +221,7 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.getZoneList()
|
||||
this.title = "添加国家地区";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
@ -238,6 +232,7 @@ export default {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改国家地区";
|
||||
this.getZoneList()
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
||||
@ -26,50 +26,20 @@
|
||||
v-hasPermi="['base:zone:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['base:zone:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['base:zone:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['base:zone:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="zoneList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键" align="center" prop="id" />
|
||||
<el-table-column label="时区标准名称" align="center" prop="zoneName" />
|
||||
<el-table-column label="UTC 偏移量" align="center" prop="utcOffset" />
|
||||
<el-table-column label="时区缩写" align="center" prop="abbreviation" />
|
||||
<el-table-column label="是否使用夏令时" align="center" prop="usesDst" />
|
||||
<el-table-column label="是否使用夏令时" align="center" prop="usesDst">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.usesDst == 1 ? '是' : '否'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="夏令时偏移量" align="center" prop="dstOffset" />
|
||||
<el-table-column label="时区描述" align="center" prop="description" />
|
||||
<el-table-column label="时区描述" align="left" width="400" prop="description" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -89,7 +59,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user