新增TKmapper自动生成部分代码功能组件

This commit is contained in:
gy b
2024-01-05 15:03:06 +08:00
parent fee63623ad
commit 8a9cdd09fc
19 changed files with 1039 additions and 3 deletions
@@ -0,0 +1,117 @@
package com.ruoyi.system.domain.entity.baseinfo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@Table(name = "country")
public class Country {
/**
* 国家ID
*/
@Id
@Column(name = "CountryId")
@GeneratedValue(generator = "JDBC")
private Integer countryid;
/**
* 国家名称
*/
@Column(name = "CountryName")
private String countryname;
/**
* 国家英文名
*/
@Column(name = "EnglishName")
private String englishname;
/**
* 国家缩写
*/
@Column(name = "AbbreviationName")
private String abbreviationname;
/**
* 国家名本地
*/
@Column(name = "CountryNameLocal")
private String countrynamelocal;
/**
* 国家标志路径
*/
@Column(name = "FlagPath")
private String flagpath;
/**
* 是否启用 1代表启用0代表不启用
*/
@Column(name = "IsActive")
private Byte isactive;
/**
* 经度
*/
@Column(name = "Longitude")
private BigDecimal longitude;
/**
* 纬度
*/
@Column(name = "Latitude")
private BigDecimal latitude;
/**
* 主页路径
*/
private String url;
/**
* 时区
*/
@Column(name = "Timezone")
private Integer timezone;
/**
* 创建人
*/
@Column(name = "CreatedBy")
private Integer createdby;
/**
* 创建时间
*/
@Column(name = "DateCreated")
private Date datecreated;
/**
* 更新人
*/
@Column(name = "UpdatedBy")
private Integer updatedby;
/**
* 更新时间
*/
@Column(name = "DateUpdated")
private Date dateupdated;
/**
* 国家地图Json
*/
@Column(name = "CountryJson")
private String countryjson;
}
@@ -0,0 +1,16 @@
package com.ruoyi.system.mapper.baseinfo;
import com.ruoyi.system.domain.entity.baseinfo.Country;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface CountryDAO {
/**
* 查询国家
*/
@Select("select * from country where CountryId=${CountryId}")
List<Country> selectCountryInfoById(@Param("CountryId") Integer CountryId);
}
@@ -0,0 +1,8 @@
package com.ruoyi.system.mapper.baseinfo;
import com.ruoyi.system.domain.entity.baseinfo.Country;
import tk.mybatis.mapper.common.Mapper;
public interface CountryMapper extends Mapper<Country> {
}
@@ -0,0 +1,25 @@
package com.ruoyi.system.service;
import com.ruoyi.system.domain.entity.baseinfo.Country;
import com.ruoyi.system.mapper.baseinfo.CountryDAO;
import com.ruoyi.system.mapper.baseinfo.CountryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class TestMapperService {
@Autowired
CountryMapper countryMapper;
@Autowired
CountryDAO countryDAO;
public Object queryCountry() {
List<Country> countries = countryMapper.selectAll();
return countries;
}
public Object queryCountryById(Integer countryId) {
List<Country> countries = countryDAO.selectCountryInfoById(countryId);
return countries;
}
}