package com.hzya.frame.grpU8.dictCheckType.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntity;
import com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntityVo;
import com.hzya.frame.grpU8.dictCheckType.entity.DictCheckTypeEntity;
import com.hzya.frame.grpU8.dictCheckType.dao.IDictCheckTypeDao;
import com.hzya.frame.grpU8.dictCheckType.entity.DictCheckTypeEntityVo;
import com.hzya.frame.grpU8.dictCheckType.service.IDictCheckTypeService;
import org.springframework.stereotype.Service; 
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;

import java.util.List;

/**
 * 子表(DictCheckType)表服务实现类
 *
 * @author makejava
 * @since 2024-07-09 11:24:25
 */
@Service(value = "dictCheckTypeService")
public class DictCheckTypeServiceImpl extends BaseService<DictCheckTypeEntity, String> implements IDictCheckTypeService {
     
    private IDictCheckTypeDao dictCheckTypeDao;
    
    @Autowired
	public void setDictCheckTypeDao(IDictCheckTypeDao dao) {
		this.dictCheckTypeDao = dao;
		this.dao = dao;
	}
	/**
	 * @param jsonObject
	 * @return com.hzya.frame.web.entity.JsonResultEntity
	 * @Author lvleigang
	 * @Description 数据表
	 * @Date 11:52 上午 2024/3/27
	 **/
	@Override
	public Object queryData(JSONObject jsonObject) {
		DictCheckTypeEntity entity = getData("jsonStr", jsonObject, DictCheckTypeEntity.class);
		if(entity == null ){
			entity = new DictCheckTypeEntity();
		}
		//判断分页
		if (entity.getPageNum() != null && entity.getPageSize() != null) {
			PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
			List<DictCheckTypeEntityVo> list = dictCheckTypeDao.queryData(entity);
			PageInfo pageInfo = new PageInfo(list);
			JSONObject object = new JSONObject();
			object.put("status","success");
			object.put("data",pageInfo);
			return object;
		}else {
			List<DictCheckTypeEntityVo> list = dictCheckTypeDao.queryData(entity);
			JSONObject object = new JSONObject();
			object.put("status","success");
			object.put("data",list);
			return object;
		}
	}
}
