|
|
@ -3,7 +3,7 @@ package ${packageName}.service.impl;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
#foreach ($column in $columns)
|
|
|
|
#foreach ($column in $columns)
|
|
|
|
#if($column.javaField == 'createTime' || $column.javaField == 'updateTime')
|
|
|
|
#if($column.javaField == 'createTime' || $column.javaField == 'updateTime')
|
|
|
|
import com.ruoyi.common.core.utils.DateUtils;
|
|
|
|
import com.scxt.common.core.utils.DateUtils;
|
|
|
|
#break
|
|
|
|
#break
|
|
|
|
#end
|
|
|
|
#end
|
|
|
|
#end
|
|
|
|
#end
|
|
|
@ -11,7 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
#if($table.sub)
|
|
|
|
#if($table.sub)
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
|
|
import com.scxt.common.core.utils.StringUtils;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import ${packageName}.domain.${subClassName};
|
|
|
|
import ${packageName}.domain.${subClassName};
|
|
|
|
#end
|
|
|
|
#end
|
|
|
@ -34,13 +34,13 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询${functionName}
|
|
|
|
* 查询${functionName}
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param ${pkColumn.javaField} ${functionName}ID
|
|
|
|
* @param ${pkColumn.javaField} ${functionName}主键
|
|
|
|
* @return ${functionName}
|
|
|
|
* @return ${functionName}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ${ClassName} select${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField})
|
|
|
|
public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField})
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return ${className}Mapper.select${ClassName}ById(${pkColumn.javaField});
|
|
|
|
return ${className}Mapper.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -108,34 +108,34 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 批量删除${functionName}
|
|
|
|
* 批量删除${functionName}
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param ${pkColumn.javaField}s 需要删除的${functionName}ID
|
|
|
|
* @param ${pkColumn.javaField}s 需要删除的${functionName}主键
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#if($table.sub)
|
|
|
|
#if($table.sub)
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
#end
|
|
|
|
#end
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int delete${ClassName}ByIds(${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
|
|
|
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if($table.sub)
|
|
|
|
#if($table.sub)
|
|
|
|
${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s);
|
|
|
|
${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s);
|
|
|
|
#end
|
|
|
|
#end
|
|
|
|
return ${className}Mapper.delete${ClassName}ByIds(${pkColumn.javaField}s);
|
|
|
|
return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaField}s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 删除${functionName}信息
|
|
|
|
* 删除${functionName}信息
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param ${pkColumn.javaField} ${functionName}ID
|
|
|
|
* @param ${pkColumn.javaField} ${functionName}主键
|
|
|
|
* @return 结果
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int delete${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField})
|
|
|
|
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField})
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if($table.sub)
|
|
|
|
#if($table.sub)
|
|
|
|
${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField});
|
|
|
|
${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField});
|
|
|
|
#end
|
|
|
|
#end
|
|
|
|
return ${className}Mapper.delete${ClassName}ById(${pkColumn.javaField});
|
|
|
|
return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if($table.sub)
|
|
|
|
#if($table.sub)
|
|
|
|
|
|
|
|
|
|
|
@ -147,7 +147,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|
|
|
public void insert${subClassName}(${ClassName} ${className})
|
|
|
|
public void insert${subClassName}(${ClassName} ${className})
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List();
|
|
|
|
List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List();
|
|
|
|
Long ${pkColumn.javaField} = ${className}.get${pkColumn.capJavaField}();
|
|
|
|
${pkColumn.javaType} ${pkColumn.javaField} = ${className}.get${pkColumn.capJavaField}();
|
|
|
|
if (StringUtils.isNotNull(${subclassName}List))
|
|
|
|
if (StringUtils.isNotNull(${subclassName}List))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<${subClassName}> list = new ArrayList<${subClassName}>();
|
|
|
|
List<${subClassName}> list = new ArrayList<${subClassName}>();
|
|
|
|