package cn.cslg.pas.mapper;

import cn.cslg.pas.domain.asso.AssoProductPatent;
import cn.cslg.pas.mapper.asso.AssoProductPatentMapper;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @Author chenyu
 * @Date 2023/3/16
 */
@Slf4j
@SpringBootTest
public class AssoProductPatentMapperTests {
    @Autowired
    private AssoProductPatentMapper assoProductPatentMapper;

    @Test
    void insert() {
        AssoProductPatent assoProductPatent = new AssoProductPatent()
                .setPatentNo("dsadsa3213SD")
                .setProductId(2);
        int rows = assoProductPatentMapper.insert(assoProductPatent);
        log.info("插入数据完成，返回受影响的行数：{}", rows);
    }

    @Test
    void deleteByProductId() {
        int rows = assoProductPatentMapper.deleteByProductId(2);
        log.info("根据产品id删除数据完成，返回受影响的行数：{}", rows);
    }

}
