<?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.jeecg.modules.basedata.mapper.FdQuotationTemplateMapper">

    <select id="findByPage" resultType="org.jeecg.modules.basedata.entity.FdQuotationTemplate">
       SELECT
            fqt.id,
            fqt.type,
            fqt.`name`,
            fqt.description,
            fqt.create_time
        FROM
            fd_quotation_template fqt
            ${ew.customSqlSegment}
    </select>

    <update id="parentIdBatch" parameterType="java.util.List">
        <foreach collection="templateItemList" item="templateItem" index="index" open="" close="" separator=";">
            update fd_quotation_template_item
            <set>
                parent_id =#{templateItem.parentId}
            </set>
            <where>
                id=#{templateItem.id}
            </where>
        </foreach>
    </update>
</mapper>