package com.cool.store.dao;

import com.cool.store.entity.BuildInformationDO;
import com.cool.store.mapper.BuildInformationMapper;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;

/**
 * @Author: WangShuo
 * @Date: 2024/10/09/下午2:18
 * @Version 1.0
 * @注释:
 */
@Repository
public class BuildInformationDAO {
    @Resource
    private BuildInformationMapper buildInformationMapper;

    public Integer insertSelective(BuildInformationDO buildInformationDO) {
        if (buildInformationDO == null) {
            return 0;
        }
        return buildInformationMapper.insertSelective(buildInformationDO);
    }

    public Integer updateByShopIdSelective(BuildInformationDO buildInformationDO) {
        if (buildInformationDO == null) {
            return 0;
        }
        Example example = new Example(BuildInformationDO.class);
        example.createCriteria().andEqualTo("shopId", buildInformationDO.getShopId());
        return buildInformationMapper.updateByExampleSelective(buildInformationDO,example);
    }
    public BuildInformationDO selectOneByShopId(Long shopId) {
        Example example = new Example(BuildInformationDO.class);
        example.createCriteria().andEqualTo("shopId",shopId);
        return buildInformationMapper.selectOneByExample(example);
    }


}
