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

import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.versionParameter.dao.ISysVersionParameterMapper;
import com.hzya.frame.sys.versionParameter.entity.SysVersionParameter;
import com.hzya.frame.serviceUtil.ServiceUtil;
import com.hzya.frame.sys.versionParameter.service.ISysVersionParameterService;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * @description: 产品版本参数表  service
 * @tableName:   sys_version_parameter
 * @entityName:  SysVersionParameter
 * @author: 	 llg
 * @history:	 1.0
 */
@Service(value = "sysVersionParameterService")
public class  SysVersionParameterServiceImpl extends ServiceUtil implements ISysVersionParameterService {

	@Resource
	private ISysVersionParameterMapper sysVersionParameterMapper;


	/**
	 * @Author lvleigang
	 * @Description  根据产品和版本获取参数
	 * @Date 4:26 下午 2023/3/14
	 * @param jsonObject
	 * @return com.hzya.frame.web.entity.JsonResultEntity
	 **/
	@Override
	public JsonResultEntity queryVersionParameter(JSONObject jsonObject) {
		SysVersionParameter sysVersionParameter = getData("jsonStr",jsonObject,SysVersionParameter.class);
		if(sysVersionParameter == null || sysVersionParameter.getProductVersionId() == null || sysVersionParameter.getProductId() == null){
			return BaseResult.getFailureMessageEntity("查询参数不存在");
		}
		sysVersionParameter.setSts("Y");
		//查询产品参数
		List<SysVersionParameter> sysVersionParameterList = sysVersionParameterMapper.entity_list_base(sysVersionParameter);
		return BaseResult.getSuccessMessageEntity("获取产品参数成功", sysVersionParameterList);
	}
}
