package com.css.txw.mhzc.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.css.ggzc.framework.common.util.gy.GyUtils;
import com.css.ggzc.framework.common.util.object.BeanUtils;
import com.css.txw.mhzc.pojo.vo.SyzxxxVO;
import com.css.txw.mhzc.service.TxwMhzcZxxxbService;
import com.css.txw.mhzc.pojo.domain.TxwMhzcZxxxbDO;
import com.css.txw.mhzc.mapper.TxwMhzcZxxxbMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
* @author AirlH
* @description 针对表【txw_mhzc_zxxxb(咨询信息表)】的数据库操作Service实现
* @createDate 2025-09-18 16:39:32
*/
@Service
public class TxwMhzcZxxxbServiceImpl extends ServiceImpl<TxwMhzcZxxxbMapper, TxwMhzcZxxxbDO>
    implements TxwMhzcZxxxbService {

    @Resource
    private TxwMhzcZxxxbMapper zxxxbMapper;

    @Override
    public Map<String, List<SyzxxxVO>> zxxx() {
        List<TxwMhzcZxxxbDO> all = zxxxbMapper.getAll();
        if (GyUtils.isNull(all)) return null;
        List<SyzxxxVO> syzxxxVOS = BeanUtils.toBean(all, SyzxxxVO.class);
        return syzxxxVOS.stream().collect(Collectors.groupingBy(SyzxxxVO::getZxLx));
    }
}




