package com.org.hktshop.service.System;

import com.org.hktshop.Interface.system.HktSystemRoleService;
import com.org.hktshop.base.BaseService;
import com.org.hktshop.entity.system.HktSystemRole;
import com.org.hktshop.utils.ExecSqlLib;
import com.org.hktshop.utils.StringUtils;
import org.springframework.stereotype.Service;

/**
 * 系统角色
 * @author hotking03
 */
@Service
public class HktSystemRoleServiceImpl extends BaseService<HktSystemRole> implements HktSystemRoleService {
    @Override
    public void updateSystemRole(HktSystemRole hktSystemRole) {
        String sql = StringUtils.isNull(hktSystemRole.getId()) ? ExecSqlLib.GetInsertSql(hktSystemRole) : ExecSqlLib.GetUpdateSql(hktSystemRole);
        this.baseJdbcDao.execute(sql);
    }

    @Override
    public void delSystemRole(HktSystemRole hktSystemRole) {
        String sql = StringUtils.isNull(hktSystemRole.getHktSystemId()) ? ExecSqlLib.GetDeleteSql(hktSystemRole) : ExecSqlLib.GetUpdateSql(hktSystemRole);
        this.baseJdbcDao.execute(sql);
    }

    @Override
    public HktSystemRole findSystemRole(HktSystemRole hktSystemRole) {
        String sql = ExecSqlLib.GetQuerySql(hktSystemRole);
        return this.baseJdbcDao.query(sql,hktSystemRole);
    }

    @Override
    public Object selectSystemRole(HktSystemRole hktSystemRole) {
        String sql = ExecSqlLib.GetQuerySql(hktSystemRole);
        return this.baseJdbcDao.queryPage(sql,hktSystemRole);
    }
}
