package com.unis.crk.basic.service.impl;

import com.unis.crk.basic.entity.UserOperationtype;
import com.unis.crk.basic.mapper.UserOperationtypeMapper;
import com.unis.crk.basic.service.IUserOperationtypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang.StringUtils;

import java.util.List;
import java.util.Map;
import cn.hutool.json.JSONObject;
import com.unis.crk.basic.entity.vo.UserOperationtypeVo;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * <p>
 * 操作类型表 服务实现类
 * </p>
 *
 * @author ghh
 * @since 2021-12-13
 */
@Service
public class UserOperationtypeServiceImpl extends ServiceImpl<UserOperationtypeMapper, UserOperationtype> implements IUserOperationtypeService {

    @Resource
    private UserOperationtypeMapper userOperationtypeMapper;


    /**
     *修改操作类型表
     * @param qcrk 操作类型表业务数据
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public JSONObject update(UserOperationtype qcrk){
        return null;
    }
    /**
     *删除操作类型表数据
     * @param id 操作类型表主键尖
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public JSONObject delete(String id){
        return null;
        }

    /**
     * 按照条件查询操作类型表信息
     * @param pageQuery
     * @throws Exception
     */
    @Override
    public IPage<Map<String,Object>> findPageVo(UserOperationtypeVo pageQuery){
        {
        //条形查询器
        QueryWrapper<UserOperationtype> queryWrapper = new QueryWrapper<>();

        //分页相关
        Page<UserOperationtype> p =new Page<>(pageQuery.getPage(),pageQuery.getLimit());

        IPage<Map<String,Object>> page = userOperationtypeMapper.selectMyMapsPage(p,queryWrapper);
        return page;
        }
    }

        @Override
        public List<Map<String, Object>> getPerData(UserOperationtypeVo pageQuery) {
            List<Map<String,Object>> list = userOperationtypeMapper.getPerData(pageQuery);
        return list;
        }
}
