package com.ghy.order.service.impl;

import java.util.List;
import com.ghy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ghy.order.mapper.OrderDetailInsuranceUserMapper;
import com.ghy.order.domain.OrderDetailInsuranceUser;
import com.ghy.order.service.IOrderDetailInsuranceUserService;
import com.ghy.common.core.text.Convert;

/**
 * 订单保险人员Service业务层处理
 *
 * @author clunt
 * @date 2024-10-21
 */
@Service
public class OrderDetailInsuranceUserServiceImpl implements IOrderDetailInsuranceUserService
{

    @Autowired
    private OrderDetailInsuranceUserMapper orderDetailInsuranceUserMapper;

    /**
     * 查询订单保险人员
     *
     * @param id 订单保险人员主键
     * @return 订单保险人员
     */
    @Override
    public OrderDetailInsuranceUser selectOrderDetailInsuranceUserById(Long id)
    {
        return orderDetailInsuranceUserMapper.selectOrderDetailInsuranceUserById(id);
    }

    /**
     * 查询订单保险人员列表
     *
     * @param orderDetailInsuranceUser 订单保险人员
     * @return 订单保险人员
     */
    @Override
    public List<OrderDetailInsuranceUser> selectOrderDetailInsuranceUserList(OrderDetailInsuranceUser orderDetailInsuranceUser)
    {
        return orderDetailInsuranceUserMapper.selectOrderDetailInsuranceUserList(orderDetailInsuranceUser);
    }

    /**
     * 新增订单保险人员
     *
     * @param orderDetailInsuranceUser 订单保险人员
     * @return 结果
     */
    @Override
    public int insertOrderDetailInsuranceUser(OrderDetailInsuranceUser orderDetailInsuranceUser)
    {
        orderDetailInsuranceUser.setCreateTime(DateUtils.getNowDate());
        return orderDetailInsuranceUserMapper.insertOrderDetailInsuranceUser(orderDetailInsuranceUser);
    }

    /**
     * 修改订单保险人员
     *
     * @param orderDetailInsuranceUser 订单保险人员
     * @return 结果
     */
    @Override
    public int updateOrderDetailInsuranceUser(OrderDetailInsuranceUser orderDetailInsuranceUser)
    {
        orderDetailInsuranceUser.setUpdateTime(DateUtils.getNowDate());
        return orderDetailInsuranceUserMapper.updateOrderDetailInsuranceUser(orderDetailInsuranceUser);
    }

    /**
     * 批量删除订单保险人员
     *
     * @param ids 需要删除的订单保险人员主键
     * @return 结果
     */
    @Override
    public int deleteOrderDetailInsuranceUserByIds(String ids)
    {
        return orderDetailInsuranceUserMapper.deleteOrderDetailInsuranceUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单保险人员信息
     *
     * @param id 订单保险人员主键
     * @return 结果
     */
    @Override
    public int deleteOrderDetailInsuranceUserById(Long id)
    {
        return orderDetailInsuranceUserMapper.deleteOrderDetailInsuranceUserById(id);
    }
}
