mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-27 04:01:56 +08:00
共通字段自动填充
This commit is contained in:
@@ -1,60 +1,60 @@
|
||||
package com.ruoyi.gen.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.gen.domain.GenTableColumn;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务字段 数据层
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface GenTableColumnMapper
|
||||
{
|
||||
public interface GenTableColumnMapper {
|
||||
/**
|
||||
* 根据表名称查询列信息
|
||||
*
|
||||
*
|
||||
* @param tableName 表名称
|
||||
* @return 列信息
|
||||
*/
|
||||
public List<GenTableColumn> selectDbTableColumnsByName(String tableName);
|
||||
List<GenTableColumn> selectDbTableColumnsByName(String tableName);
|
||||
|
||||
/**
|
||||
* 查询业务字段列表
|
||||
*
|
||||
*
|
||||
* @param tableId 业务字段编号
|
||||
* @return 业务字段集合
|
||||
*/
|
||||
public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
|
||||
List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
|
||||
|
||||
/**
|
||||
* 新增业务字段
|
||||
*
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGenTableColumn(GenTableColumn genTableColumn);
|
||||
int insertGenTableColumn(GenTableColumn genTableColumn);
|
||||
|
||||
/**
|
||||
* 修改业务字段
|
||||
*
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGenTableColumn(GenTableColumn genTableColumn);
|
||||
int updateGenTableColumn(GenTableColumn genTableColumn);
|
||||
|
||||
/**
|
||||
* 删除业务字段
|
||||
*
|
||||
*
|
||||
* @param genTableColumns 列数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGenTableColumns(List<GenTableColumn> genTableColumns);
|
||||
int deleteGenTableColumns(List<GenTableColumn> genTableColumns);
|
||||
|
||||
/**
|
||||
* 批量删除业务字段
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGenTableColumnByIds(Long[] ids);
|
||||
int deleteGenTableColumnByIds(Long[] ids);
|
||||
}
|
||||
@@ -1,68 +1,64 @@
|
||||
package com.ruoyi.gen.service;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.gen.domain.GenTableColumn;
|
||||
import com.ruoyi.gen.mapper.GenTableColumnMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务字段 服务层实现
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class GenTableColumnServiceImpl implements IGenTableColumnService
|
||||
{
|
||||
@Autowired
|
||||
private GenTableColumnMapper genTableColumnMapper;
|
||||
public class GenTableColumnServiceImpl implements IGenTableColumnService {
|
||||
@Autowired
|
||||
private GenTableColumnMapper genTableColumnMapper;
|
||||
|
||||
/**
|
||||
/**
|
||||
* 查询业务字段列表
|
||||
*
|
||||
*
|
||||
* @param tableId 业务字段编号
|
||||
* @return 业务字段集合
|
||||
*/
|
||||
@Override
|
||||
public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId)
|
||||
{
|
||||
return genTableColumnMapper.selectGenTableColumnListByTableId(tableId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId) {
|
||||
return genTableColumnMapper.selectGenTableColumnListByTableId(tableId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增业务字段
|
||||
*
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertGenTableColumn(GenTableColumn genTableColumn)
|
||||
{
|
||||
return genTableColumnMapper.insertGenTableColumn(genTableColumn);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改业务字段
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateGenTableColumn(GenTableColumn genTableColumn)
|
||||
{
|
||||
return genTableColumnMapper.updateGenTableColumn(genTableColumn);
|
||||
}
|
||||
@Override
|
||||
public int insertGenTableColumn(GenTableColumn genTableColumn) {
|
||||
return genTableColumnMapper.insertGenTableColumn(genTableColumn);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 修改业务字段
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateGenTableColumn(GenTableColumn genTableColumn) {
|
||||
return genTableColumnMapper.updateGenTableColumn(genTableColumn);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除业务字段对象
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGenTableColumnByIds(String ids)
|
||||
{
|
||||
return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids));
|
||||
}
|
||||
@Override
|
||||
public int deleteGenTableColumnByIds(String ids) {
|
||||
return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,45 @@
|
||||
package com.ruoyi.gen.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.gen.domain.GenTableColumn;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务字段 服务层
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IGenTableColumnService
|
||||
{
|
||||
public interface IGenTableColumnService {
|
||||
|
||||
/**
|
||||
* 查询业务字段列表
|
||||
*
|
||||
*
|
||||
* @param tableId 业务字段编号
|
||||
* @return 业务字段集合
|
||||
*/
|
||||
public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
|
||||
List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId);
|
||||
|
||||
/**
|
||||
* 新增业务字段
|
||||
*
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGenTableColumn(GenTableColumn genTableColumn);
|
||||
int insertGenTableColumn(GenTableColumn genTableColumn);
|
||||
|
||||
/**
|
||||
* 修改业务字段
|
||||
*
|
||||
*
|
||||
* @param genTableColumn 业务字段信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGenTableColumn(GenTableColumn genTableColumn);
|
||||
int updateGenTableColumn(GenTableColumn genTableColumn);
|
||||
|
||||
/**
|
||||
* 删除业务字段信息
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGenTableColumnByIds(String ids);
|
||||
int deleteGenTableColumnByIds(String ids);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import ${packageName}.domain.${subClassName};
|
||||
#end
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import com.ruoyi.common.security.utils.SecurityUtilsExt
|
||||
import ${packageName}.mapper.${ClassName}Mapper;
|
||||
import ${packageName}.domain.${ClassName};
|
||||
import ${packageName}.mapper.${ClassName}DynamicSqlSupport;
|
||||
@@ -167,9 +168,11 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s);
|
||||
#end
|
||||
## return ${className}Mapper.delete(dsl -> dsl.where(${ClassName}DynamicSqlSupport.${pkColumn.javaField}, SqlBuilder.isIn(${pkColumn.javaField}s)));
|
||||
String userId = SecurityUtilsExt.getUserIdStr();
|
||||
UpdateStatementProvider provider = SqlBuilder.update(UnitInfoDynamicSqlSupport.${className})
|
||||
.set(${ClassName}DynamicSqlSupport.deleteFlag).equalTo(ExtBaseEntity.DELETED)
|
||||
.set(${ClassName}DynamicSqlSupport.updateTime).equalTo(DateUtils.getNowDate())
|
||||
.set(${ClassName}DynamicSqlSupport.updateBy).equalTo(userId)
|
||||
.where(${ClassName}DynamicSqlSupport.unitCode, SqlBuilder.isIn(${pkColumn.javaField}s))
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
<!-- MyBatis3 动态SQL生成 -->
|
||||
<context id="mbg" targetRuntime="MyBatis3DynamicSql">
|
||||
|
||||
<!-- 插件 -->
|
||||
<plugin type="com.ruoyi.common.datasource.mybatis.gen.RyasMyBatisDynamicPlugin"/>
|
||||
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"/>
|
||||
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
|
||||
|
||||
<commentGenerator>
|
||||
<property name="suppressAllComments" value="false"/>
|
||||
<property name="suppressDate" value="true"/>
|
||||
@@ -17,7 +22,7 @@
|
||||
userId="root"
|
||||
password="password"/>
|
||||
|
||||
<!-- Java 模型 -->
|
||||
<!-- Java Entity -->
|
||||
<javaModelGenerator targetPackage="com.ruoyi.system.domain" targetProject="ruoyi-modules/ruoyi-system/src/main/java">
|
||||
<property name="rootClass" value="com.ruoyi.common.core.web.domain.BaseEntity"/>
|
||||
<property name="enableSubPackages" value="true" />
|
||||
@@ -25,9 +30,9 @@
|
||||
</javaModelGenerator>
|
||||
|
||||
<!-- Mapper.xml (对于MyBatis动态SQL特性来说不再需要) -->
|
||||
<sqlMapGenerator targetPackage="mappers" targetProject="ruoyi-modules/ruoyi-system/src/main/resources">
|
||||
<property name="enableSubPackages" value="true" />
|
||||
</sqlMapGenerator>
|
||||
<!-- <sqlMapGenerator targetPackage="com.ruoyi.system.mapper" targetProject="ruoyi-modules/ruoyi-system/src/main/resources">-->
|
||||
<!-- <property name="enableSubPackages" value="true" />-->
|
||||
<!-- </sqlMapGenerator>-->
|
||||
|
||||
<!-- Mapper.java -->
|
||||
<javaClientGenerator targetPackage="com.ruoyi.system.mapper" targetProject="ruoyi-modules/ruoyi-system/src/main/java" type="XMLMAPPER">
|
||||
|
||||
@@ -2,13 +2,16 @@ package com.ruoyi.wms.domain;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import jakarta.annotation.Generated;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Database Table Remarks:
|
||||
* 单位基础信息表
|
||||
*
|
||||
* This class was generated by MyBatis Generator.
|
||||
* This class corresponds to the database table SF_WMS_M_UNIT_INFO
|
||||
*/
|
||||
public class UnitInfo extends ExtBaseEntity {
|
||||
public class UnitInfo extends ExtBaseEntity implements Serializable {
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 单位代码
|
||||
@@ -58,6 +61,9 @@ public class UnitInfo extends ExtBaseEntity {
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.REMARK_5")
|
||||
private String remark5;
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT_CODE")
|
||||
public String getUnitCode() {
|
||||
return unitCode;
|
||||
@@ -127,4 +133,23 @@ public class UnitInfo extends ExtBaseEntity {
|
||||
public void setRemark5(String remark5) {
|
||||
this.remark5 = remark5 == null ? null : remark5.trim();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", unitCode=").append(unitCode);
|
||||
sb.append(", unitName=").append(unitName);
|
||||
sb.append(", remark1=").append(remark1);
|
||||
sb.append(", remark2=").append(remark2);
|
||||
sb.append(", remark3=").append(remark3);
|
||||
sb.append(", remark4=").append(remark4);
|
||||
sb.append(", remark5=").append(remark5);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,9 @@
|
||||
package com.ruoyi.wms.mapper;
|
||||
|
||||
import static com.ruoyi.wms.mapper.UnitInfoDynamicSqlSupport.*;
|
||||
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
|
||||
|
||||
import com.ruoyi.common.security.utils.SecurityUtilsExt;
|
||||
import com.ruoyi.wms.domain.UnitInfo;
|
||||
import jakarta.annotation.Generated;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Result;
|
||||
import org.apache.ibatis.annotations.ResultMap;
|
||||
import org.apache.ibatis.annotations.Results;
|
||||
import org.apache.ibatis.annotations.SelectProvider;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.mybatis.dynamic.sql.BasicColumn;
|
||||
import org.mybatis.dynamic.sql.delete.DeleteDSLCompleter;
|
||||
@@ -23,11 +14,14 @@ import org.mybatis.dynamic.sql.update.UpdateDSL;
|
||||
import org.mybatis.dynamic.sql.update.UpdateDSLCompleter;
|
||||
import org.mybatis.dynamic.sql.update.UpdateModel;
|
||||
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.CommonCountMapper;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.CommonDeleteMapper;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.CommonInsertMapper;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.CommonUpdateMapper;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.MyBatis3Utils;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static com.ruoyi.wms.mapper.UnitInfoDynamicSqlSupport.*;
|
||||
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
|
||||
|
||||
@Mapper
|
||||
public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, CommonInsertMapper<UnitInfo>, CommonUpdateMapper {
|
||||
@@ -78,6 +72,7 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
default int insert(UnitInfo row) {
|
||||
row.setCommonForInsert(SecurityUtilsExt.getUserIdStr());
|
||||
return MyBatis3Utils.insert(this::insert, row, unitInfo, c ->
|
||||
c.map(unitCode).toProperty("unitCode")
|
||||
.map(unitName).toProperty("unitName")
|
||||
@@ -98,6 +93,9 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
default int insertMultiple(Collection<UnitInfo> records) {
|
||||
for (UnitInfo row : records) {
|
||||
row.setCommonForInsert(SecurityUtilsExt.getUserIdStr());
|
||||
}
|
||||
return MyBatis3Utils.insertMultiple(this::insertMultiple, records, unitInfo, c ->
|
||||
c.map(unitCode).toProperty("unitCode")
|
||||
.map(unitName).toProperty("unitName")
|
||||
@@ -118,6 +116,7 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
default int insertSelective(UnitInfo row) {
|
||||
row.setCommonForInsert(SecurityUtilsExt.getUserIdStr());
|
||||
return MyBatis3Utils.insert(this::insert, row, unitInfo, c ->
|
||||
c.map(unitCode).toPropertyWhenPresent("unitCode", row::getUnitCode)
|
||||
.map(unitName).toPropertyWhenPresent("unitName", row::getUnitName)
|
||||
@@ -183,6 +182,7 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
static UpdateDSL<UpdateModel> updateSelectiveColumns(UnitInfo row, UpdateDSL<UpdateModel> dsl) {
|
||||
row.setCommonForUpdate(SecurityUtilsExt.getUserIdStr());
|
||||
return dsl.set(unitCode).equalToWhenPresent(row::getUnitCode)
|
||||
.set(unitName).equalToWhenPresent(row::getUnitName)
|
||||
.set(remark1).equalToWhenPresent(row::getRemark1)
|
||||
@@ -221,6 +221,7 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
default int updateByPrimaryKeySelective(UnitInfo row) {
|
||||
row.setCommonForUpdate(SecurityUtilsExt.getUserIdStr());
|
||||
return update(c ->
|
||||
c.set(unitName).equalToWhenPresent(row::getUnitName)
|
||||
.set(remark1).equalToWhenPresent(row::getRemark1)
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.utils.uuid.snowflake.SnowFlakeIdGenerator;
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import com.ruoyi.common.security.utils.SecurityUtilsExt;
|
||||
import com.ruoyi.wms.domain.UnitInfo;
|
||||
import com.ruoyi.wms.mapper.UnitInfoDynamicSqlSupport;
|
||||
import com.ruoyi.wms.mapper.UnitInfoMapper;
|
||||
@@ -70,7 +71,6 @@ public class UnitInfoServiceImpl implements IUnitInfoService {
|
||||
if (StringUtils.isBlank(unitInfo.getUnitCode())) {
|
||||
unitInfo.setUnitCode(SnowFlakeIdGenerator.nextId());
|
||||
}
|
||||
unitInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return unitInfoMapper.insertSelective(unitInfo);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,6 @@ public class UnitInfoServiceImpl implements IUnitInfoService {
|
||||
*/
|
||||
@Override
|
||||
public int updateUnitInfo(UnitInfo unitInfo) {
|
||||
unitInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return unitInfoMapper.updateByPrimaryKeySelective(unitInfo);
|
||||
}
|
||||
|
||||
@@ -94,9 +93,11 @@ public class UnitInfoServiceImpl implements IUnitInfoService {
|
||||
*/
|
||||
@Override
|
||||
public int deleteUnitInfoByUnitCodes(String[] unitCodes) {
|
||||
String userId = SecurityUtilsExt.getUserIdStr();
|
||||
UpdateStatementProvider provider = SqlBuilder.update(UnitInfoDynamicSqlSupport.unitInfo)
|
||||
.set(UnitInfoDynamicSqlSupport.deleteFlag).equalTo(ExtBaseEntity.DELETED)
|
||||
.set(UnitInfoDynamicSqlSupport.updateTime).equalTo(DateUtils.getNowDate())
|
||||
.set(UnitInfoDynamicSqlSupport.updateBy).equalTo(userId)
|
||||
.where(UnitInfoDynamicSqlSupport.unitCode, SqlBuilder.isIn(unitCodes))
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
@@ -114,7 +115,6 @@ public class UnitInfoServiceImpl implements IUnitInfoService {
|
||||
UnitInfo record = new UnitInfo();
|
||||
record.setUnitCode(unitCode);
|
||||
record.setDeleteFlag(ExtBaseEntity.DELETED);
|
||||
record.setUpdateTime(DateUtils.getNowDate());
|
||||
return unitInfoMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
<!-- MyBatis3 动态SQL生成 -->
|
||||
<context id="mbg" targetRuntime="MyBatis3DynamicSql">
|
||||
|
||||
<!-- 插件 -->
|
||||
<plugin type="com.ruoyi.common.datasource.mybatis.gen.RyasMyBatisDynamicPlugin"/>
|
||||
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"/>
|
||||
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
|
||||
|
||||
<commentGenerator>
|
||||
<property name="suppressAllComments" value="false"/>
|
||||
<property name="suppressDate" value="true"/>
|
||||
@@ -17,17 +22,17 @@
|
||||
userId="root"
|
||||
password="password"/>
|
||||
|
||||
<!-- Java 模型 -->
|
||||
<!-- Java Entity -->
|
||||
<javaModelGenerator targetPackage="com.ruoyi.wms.domain" targetProject="ruoyi-modules/ruoyi-wms/src/main/java">
|
||||
<property name="rootClass" value="com.ruoyi.common.core.web.domain.ExtBaseEntity"/>
|
||||
<property name="enableSubPackages" value="true" />
|
||||
<property name="trimStrings" value="true" />
|
||||
</javaModelGenerator>
|
||||
|
||||
<!-- Mapper.xml (对于MyBatis动态SQL特性来说不再需要) -->
|
||||
<sqlMapGenerator targetPackage="mappers" targetProject="ruoyi-modules/ruoyi-wms/src/main/resources">
|
||||
<property name="enableSubPackages" value="true" />
|
||||
</sqlMapGenerator>
|
||||
<!-- Mapper.xml (对于MyBatis动态SQL来说不需要) -->
|
||||
<!-- <sqlMapGenerator targetPackage="com.ruoyi.wms.mapper" targetProject="ruoyi-modules/ruoyi-wms/src/main/resources">-->
|
||||
<!-- <property name="enableSubPackages" value="true" />-->
|
||||
<!-- </sqlMapGenerator>-->
|
||||
|
||||
<!-- Mapper.java -->
|
||||
<javaClientGenerator targetPackage="com.ruoyi.wms.mapper" targetProject="ruoyi-modules/ruoyi-wms/src/main/java" type="XMLMAPPER">
|
||||
|
||||
Reference in New Issue
Block a user