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

com.yuweix.kuafu.permission.mapper.SysPermissionMapper Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.yuweix.kuafu.permission.mapper;


import com.yuweix.kuafu.dao.PersistUtil;
import com.yuweix.kuafu.permission.model.SysPermission;
import com.yuweix.kuafu.dao.mybatis.BaseMapper;
import com.yuweix.kuafu.dao.mybatis.provider.AbstractProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;
import java.util.Map;


/**
 * @author yuwei
 */
public interface SysPermissionMapper extends BaseMapper {
	@SelectProvider(type = Provider.class, method = "queryPermissionCount")
	int queryPermissionCount(@Param("idList")List idList, @Param("parentId")Long parentId
			, @Param("keywords")String keywords, @Param("permTypeList")List permTypeList
			, @Param("visible")Boolean visible);

	@SelectProvider(type = Provider.class, method = "queryPermissionList")
	List queryPermissionList(@Param("idList")List idList, @Param("parentId")Long parentId
			, @Param("keywords")String keywords, @Param("permTypeList")List permTypeList
			, @Param("visible")Boolean visible
			, @Param("pageNo")Integer pageNo, @Param("pageSize")Integer pageSize);

	@SelectProvider(type = Provider.class, method = "queryPermissionByNo")
	SysPermission queryPermissionByNo(@Param("permNo")String permNo);

	class Provider extends AbstractProvider {
		@SuppressWarnings("unchecked")
		public String queryPermissionCount(Map param) {
			List idList = (List) param.get("idList");
			Long parentId = (Long) param.get("parentId");
			String keywords = (String) param.get("keywords");
			List permTypeList = (List) param.get("permTypeList");
			Boolean visible = (Boolean) param.get("visible");

			StringBuilder builder = new StringBuilder("");
			builder.append("");
			return builder.toString();
		}

		@SuppressWarnings("unchecked")
		public String queryPermissionList(Map param) {
			List idList = (List) param.get("idList");
			Long parentId = (Long) param.get("parentId");
			String keywords = (String) param.get("keywords");
			List permTypeList = (List) param.get("permTypeList");
			Boolean visible = (Boolean) param.get("visible");
			Integer pageNo = (Integer) param.get("pageNo");
			Integer pageSize = (Integer) param.get("pageSize");

			StringBuilder builder = new StringBuilder("");
			builder.append("");
			return builder.toString();
		}

		public String queryPermissionByNo(Map param) {
			String permNo = (String) param.get("permNo");

			StringBuilder builder = new StringBuilder("");
			builder.append("  select ").append(PersistUtil.getAllColumnSql(SysPermission.class))
					.append(" from ").append(PersistUtil.getTableName(SysPermission.class))
					.append(" where 1 = 1 ");
			if (permNo != null && !"".equals(permNo.trim())) {
				param.put("permNo", permNo.trim());
				builder.append(" and perm_no = #{permNo} ");
			} else {
				builder.append(" and 1 = 0 ");
			}
			return builder.toString();
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy