<?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.sky.scientific.mapper.YsQtfyMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="ResultMap" type="org.sky.scientific.pojo.entity.YsQtfyEntity">
        <result column="id" property="id"/>
        <result column="tenant_id" property="tenantId"/>
        <result column="XM_ID" property="xmId"/>
        <result column="FYNR" property="fynr"/>
        <result column="YSJE" property="ysje"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>

    <resultMap id="ResultVoMap" type="org.sky.scientific.pojo.vo.YsQtfyVO" extends="ResultMap">

    </resultMap>

    <delete id="physicalDeleteByIds">
        DELETE FROM kd_ys_qtfy
        WHERE id IN
        <foreach item="id" collection="list" separator="," open="(" close=")" index="">
            #{id}
        </foreach>
    </delete>

    <select id="selectYsQtfyPage" resultMap="ResultVoMap">
        select * from kd_ys_qtfy where is_deleted = 0
        <if test="ysQtfy.xmId != null">and XM_ID = #{ysQtfy.xmId}</if>
    </select>
</mapper>
