<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.modules.bq.mapper.BqInfoMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="bqInfoResultMap" type="org.springblade.modules.bq.pojo.entity.BqInfoEntity">
        <result column="bqlx" property="bqlx"/>
        <result column="parent_id" property="parentId"/>
        <result column="name" property="name"/>
        <result column="xzzt" property="xzzt"/>
        <result column="bqdj" property="bqdj"/>
    </resultMap>

    <select id="selectBqInfoPage" resultType="org.springblade.modules.bq.pojo.vo.BqInfoVO">
        SELECT
            *
        FROM
            bq.bq_info
        WHERE
            is_deleted = 0
          AND xzzt = 1
        <if test="null != params.parentId">
          AND parent_id = #{params.parentId} :: int8
        </if>
    </select>

    <select id="exportBqInfo" resultType="org.springblade.modules.bq.excel.BqInfoExcel">
        SELECT * FROM bq_info ${ew.customSqlSegment}
    </select>

</mapper>
