All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates0.ServiceInterface.tmpl Maven / Gradle / Ivy

Go to download

Assist in generating CRUD code, without limitation on the specific language, as long as you can write velocity templates.

There is a newer version: 1.0.8
Show newest version

package ${packagePrefix}.service;

import java.util.List;
import java.util.Collection;
import ${packagePrefix}.entity.${className};
import ${packagePrefix}.dao.${className}Dao;
import com.github.pagehelper.PageInfo;
import com.kbao.core.common.web.page.Pagination;
import com.kbao.core.common.web.page.RequestPage;
import com.kbao.market.ds.mongo.BaseMarketMongoServiceImpl;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

 /**
 *
 * @ClassName ${className}Service
 * @Description
 * @author ${author}
 * @version V1.0
 * @since V1.0
 * @date ${date}
 *
 */

@Service
public class  ${className}Service extends BaseMarketMongoServiceImpl<${className}, String, ${className}Dao>{

    /**
	 *
	 * @Description: 分页查询
	 * @since V1.0
	 * @param param
	 */
	public PageInfo<${className}> page(RequestPage param) {
		Pagination<${className}> page = new Pagination<${className}>();
		page.setPageNum(param.getPageNum());
		page.setPageSize(param.getPageSize());
		Query query = new Query();
		return super.page(query, page);
	}


 /**
	 * @Description: 批量删除
	 * @since V1.0
	 * @param ids
	 */
	public void batchDelete(List ids){
		for (String id : ids) {
			super.remove(id);
		}
	}

    /**
	 * @Description: 查找
	 * @since V1.0
	 * @param ${classVar}
	 */
	public  List<${className}> find (${className} ${classVar} ){
		 Query query = new Query();
		return super.find(query);
	}

	@Override
	protected String getSeriesName() {
		// TODO Auto-generated method stub
		return null;
	}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy