package com.hzya.frame.sys.dictionaryshopNew.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.BaseResult;
import org.springframework.stereotype.Service;
import com.hzya.frame.serviceUtil.ServiceUtil;
import com.hzya.frame.sys.dictionaryshopNew.entity.SysDictionaryshopNew;
import com.hzya.frame.sys.dictionaryshopNew.service.ISysDictionaryshopNewService;
import com.hzya.frame.sys.dictionaryshopNew.dao.ISysDictionaryshopNewMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.hzya.frame.web.entity.JsonResultEntity;

import javax.annotation.Resource;
import java.util.List;


/**
 * @description: 数据字典表  service
 * @tableName:   sys_dictionaryshop_new
 * @entityName:  SysDictionaryshopNew
 * @author: 	 gjh
 * @history:	 1.0
 */
@Service(value="sysdictionaryshopnewService")
public class  SysDictionaryshopNewServiceImpl extends ServiceUtil implements ISysDictionaryshopNewService{
	private final Logger logger = LoggerFactory.getLogger(this.getClass());

	@Resource
	protected ISysDictionaryshopNewMapper  sysdictionaryshopnewMapper;

	@Override
	public JsonResultEntity test(SysDictionaryshopNew object) {
		return BaseResult.getSuccessMessageEntity("获取应用成功");
	}

	/**
	 * 查询数据字典
	 *
	 * @param tabName     表名
	 * @param columnName  字段名
	 * @param columnValue 字典值
	 * @return
	 */
	@Override
	public SysDictionaryshopNew getDictionaryshopByValue(String tabName, String columnName, String columnValue) {
		SysDictionaryshopNew sysDictionaryshopNew = new SysDictionaryshopNew();
		sysDictionaryshopNew.setTabName(tabName);
		sysDictionaryshopNew.setColumnName(columnName);
		sysDictionaryshopNew.setColumnValue(columnValue);
		return sysdictionaryshopnewMapper.entity_get_by_value(sysDictionaryshopNew);
	}

	/**
	 * 查询列表
	 *
	 * @param object
	 * @return
	 */
	@Override
	public JsonResultEntity queryDictionaryList(JSONObject object) {
		SysDictionaryshopNew dictionary = getData("jsonStr", object, SysDictionaryshopNew.class);
		List<SysDictionaryshopNew> dictionaryList = sysdictionaryshopnewMapper.entity_list_base(dictionary);
		return BaseResult.getSuccessMessageEntity("查询列表成功", dictionaryList);
	}
}
