package com.sooka.system.medicine.industry.service.impl;


import com.sooka.common.core.text.Convert;
import com.sooka.common.utils.DateUtils;
import com.sooka.framework.util.ShiroUtils;
import com.sooka.system.medicine.industry.domain.TGuijiMedicineIndustry;
import com.sooka.system.medicine.industry.mapper.TGuijiMedicineIndustryMapper;
import com.sooka.system.medicine.industry.service.ITGuijiMedicineIndustryService;
import com.sooka.system.service.impl.Guiji_Base_Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
 * 规上工业经济数据Service业务层处理
 *
 * @author lei
 * @date 2022-08-22
 */
@Service
public class TGuijiMedicineIndustryServiceImpl extends Guiji_Base_Service implements ITGuijiMedicineIndustryService
{
    @Resource
    private TGuijiMedicineIndustryMapper tGuijiMedicineIndustryMapper;

    /**
     * 查询规上工业经济数据
     *
     * @param id 规上工业经济数据ID
     * @return 规上工业经济数据
     */
    @Override
    public TGuijiMedicineIndustry selectTGuijiMedicineIndustryById(String id)
    {
        return tGuijiMedicineIndustryMapper.selectTGuijiMedicineIndustryById(id);
    }

    /**
     * 查询规上工业经济数据列表
     *
     * @param tGuijiMedicineIndustry 规上工业经济数据
     * @return 规上工业经济数据
     */
    @Override
    public List<TGuijiMedicineIndustry> selectTGuijiMedicineIndustryList(TGuijiMedicineIndustry tGuijiMedicineIndustry)
    {
        List<TGuijiMedicineIndustry> list = tGuijiMedicineIndustryMapper.selectTGuijiMedicineIndustryList(tGuijiMedicineIndustry);
        tGuijiMedicineIndustry.setOperationStatus(1L);
        tGuijiMedicineIndustry.setParam(tGuijiMedicineIndustry.toString());
        tGuijiMedicineIndustry.setInterfacetype("platform_interfacetype_1");//1 共享 2归集
        tGuijiMedicineIndustry.setInterfaceinfoId("f850c765-4475-4e74-9367-9e7891f3edd7");
        tGuijiMedicineIndustry.setInterfaceinfoName("共享（市）-市医药-规上工业经济数据");
        Long deptId = ShiroUtils.getSysUser().getDept().getDeptId();
        String deptName = ShiroUtils.getSysUser().getDept().getDeptName();
        tGuijiMedicineIndustry.setDeptId(deptId);
        tGuijiMedicineIndustry.setDeptName(deptName);
        add_log(tGuijiMedicineIndustry);
        return list;
    }

    /**
     * 新增规上工业经济数据
     *
     * @param tGuijiMedicineIndustry 规上工业经济数据
     * @return 结果
     */
    @Override
    public int insertTGuijiMedicineIndustry(TGuijiMedicineIndustry tGuijiMedicineIndustry)
    {
        tGuijiMedicineIndustry.setCreateTime(DateUtils.getNowDate());
        return tGuijiMedicineIndustryMapper.insertTGuijiMedicineIndustry(tGuijiMedicineIndustry);
    }

    /**
     * 修改规上工业经济数据
     *
     * @param tGuijiMedicineIndustry 规上工业经济数据
     * @return 结果
     */
    @Override
    public int updateTGuijiMedicineIndustry(TGuijiMedicineIndustry tGuijiMedicineIndustry)
    {
        return tGuijiMedicineIndustryMapper.updateTGuijiMedicineIndustry(tGuijiMedicineIndustry);
    }

    /**
     * 删除规上工业经济数据对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTGuijiMedicineIndustryByIds(String ids)
    {
        return tGuijiMedicineIndustryMapper.deleteTGuijiMedicineIndustryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除规上工业经济数据信息
     *
     * @param id 规上工业经济数据ID
     * @return 结果
     */
    @Override
    public int deleteTGuijiMedicineIndustryById(String id)
    {
        return tGuijiMedicineIndustryMapper.deleteTGuijiMedicineIndustryById(id);
    }
}
