package com.org.web.person.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.org.web.person.domain.BcPersonService;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BcPersonServiceMapper extends BaseMapper<BcPersonService> {

    @Select("<script>" +
            "select * " +
            "from bc_person_service " +
            "where is_delete = 0 "+

            " <if test = 'name != null and name != \"\"'> " +
            "  and name like concat('%', #{name}, '%') " +
            " </if> " +

            " <if test = 'idCardNo != null and idCardNo != \"\"'> " +
            "  and id_card_no like concat('%', #{idCardNo}, '%') " +
            " </if> " +

            " <if test = 'phone != null and phone != \"\"'> " +
            "  and phone like concat('%', #{phone}, '%') " +
            " </if> " +

            " order by create_time  " +
            "</script>")
    List<BcPersonService> queryList(BcPersonService person);

}
