/*
* Copyright (c) ${Company} Corporation ${Year} . All rights reserved.
*
*/
package ${srvImplPackage};

import ${daoPackage}.${javaClassRef.getClassName()}Dao;
import ${servicePackage}.${javaClassRef.getClassName()}Service;
import ${entityPackage}.${javaClassRef.getClassName()};

import net.northking.cctp.common.db.BasicDao;
import net.northking.cctp.common.db.PaginationService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.stereotype.Service;


/**
 * ${javaClassRef.getComment()}
 *
 * <p>${Attention} <br>
 * createdate:  ${now}  <br>
 * @author:  ${Author}  <br>
 * @since:  ${Version} <br>
 */
@Service
@ConditionalOnMissingBean(name = "${javaClassRef.getClassName()}ServiceImpl")
public class ${javaClassRef.getClassName()}ServiceImpl extends PaginationService<${javaClassRef.getClassName()}> implements ${javaClassRef.getClassName()}Service
{
private static final Logger logger = LoggerFactory.getLogger(${javaClassRef.getClassName()}ServiceImpl.class);

  private final ${javaClassRef.getClassName()}Dao ${javaClassRef.getRefName()}Dao;

  public ${javaClassRef.getClassName()}ServiceImpl(${javaClassRef.getClassName()}Dao ${javaClassRef.getRefName()}Dao) {this.${javaClassRef.getRefName()}Dao = ${javaClassRef.getRefName()}Dao;}

  public BasicDao<${javaClassRef.getClassName()}> getDao() {return ${javaClassRef.getRefName()}Dao;}

  public ${javaClassRef.getClassName()} createEntity() { return new ${javaClassRef.getClassName()}();}
#foreach( ${indexInfo} in ${tableRef.getIndexInfoRefs()})
  /**
   * 根据索引查找
#set($count=0)
#set($paramDefs="")
#set($paramNames="")
#foreach( ${indexColumn} in ${indexInfo.getColumnRefList()})
    #if(${count}>0)
        #set($paramDefs=$paramDefs+","+${indexColumn.getAttributesRef().getJavaTypeName()}+" "+${indexColumn.getAttributesRef().getRefName()})
        #set($paramNames=$paramNames+", "+${indexColumn.getAttributesRef().getRefName()})
    #else
        #set($paramDefs=$paramDefs + ${indexColumn.getAttributesRef().getJavaTypeName()}+" "+${indexColumn.getAttributesRef().getRefName()})
        #set($paramNames=$paramNames + ${indexColumn.getAttributesRef().getRefName()})
    #end
  * @param ${indexColumn.getAttributesRef().getRefName()} ${indexColumn.getAttributesRef().getComment()}
#set($count=$count+1)
#end
   */
  public ${javaClassRef.getClassName()} findByIndexBy${indexInfo.getCamelIndexName()} ($paramDefs)
  {
    return ${javaClassRef.getRefName()}Dao.findBy${indexInfo.getCamelIndexName()}($paramNames);
  }

#end


// ----      The End by Generator     ----//




}

