package com.sooka.system.funeral.ashes_renew.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.funeral.ashes_renew.domain.TGuijiAshesRenew;
import com.sooka.system.funeral.ashes_renew.mapper.TGuijiAshesRenewMapper;
import com.sooka.system.funeral.ashes_renew.service.ITGuijiAshesRenewService;
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 TGuijiAshesRenewServiceImpl extends Guiji_Base_Service implements ITGuijiAshesRenewService
{
    @Resource
    private TGuijiAshesRenewMapper mapper;

    /**
     * 查询市殡葬-骨灰续存基本信息
     *
     * @param id 市殡葬-骨灰续存基本信息ID
     * @return 市殡葬-骨灰续存基本信息
     */
    @Override
    public TGuijiAshesRenew selectById(String id)
    {
        return mapper.selectById(id);
    }

    /**
     * 查询市殡葬-骨灰续存基本信息列表
     *
     * @param param 市殡葬-骨灰续存基本信息
     * @return 市殡葬-骨灰续存基本信息
     */
    @Override
    public List<TGuijiAshesRenew> selectList(TGuijiAshesRenew param)
    {
        List<TGuijiAshesRenew> list = mapper.selectList(param);
        param.setOperationStatus(1L);
        param.setParam(param.toString());
        param.setInterfacetype("platform_interfacetype_1");//1 共享 2归集
        param.setInterfaceinfoId("cbc7a1a6-e0e9-4719-972b-98bfb2a3be0b");
        param.setInterfaceinfoName("共享（市）-市殡葬-骨灰续存基本信息");
        Long deptId = ShiroUtils.getSysUser().getDept().getDeptId();
        String deptName = ShiroUtils.getSysUser().getDept().getDeptName();
        param.setDeptId(deptId);
        param.setDeptName(deptName);
        add_log(param);
        return list;
    }

    /**
     * 新增市殡葬-骨灰续存基本信息
     *
     * @param param 市殡葬-骨灰续存基本信息
     * @return 结果
     */
    @Override
    public int insert(TGuijiAshesRenew param)
    {
        param.setCreateTime(DateUtils.getNowDate());
        return mapper.insert(param);
    }

    /**
     * 修改市殡葬-骨灰续存基本信息
     *
     * @param param 市殡葬-骨灰续存基本信息
     * @return 结果
     */
    @Override
    public int update(TGuijiAshesRenew param)
    {
        return mapper.update(param);
    }

    /**
     * 删除市殡葬-骨灰续存基本信息对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteByIds(String ids)
    {
        return mapper.deleteByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除市殡葬-骨灰续存基本信息信息
     *
     * @param id 市殡葬-骨灰续存基本信息ID
     * @return 结果
     */
    @Override
    public int deleteById(String id)
    {
        return mapper.deleteById(id);
    }
}
