<?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.YsSjfyMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="ResultMap" type="org.sky.scientific.pojo.entity.YsSjfyEntity">
        <result column="id" property="id"/>
        <result column="tenant_id" property="tenantId"/>
        <result column="XM_ID" property="xmId"/>
        <result column="SJNR" property="sjnr"/>
        <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.YsSjfyVO" extends="ResultMap">

    </resultMap>

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


    <select id="selectYsSjfyPage" resultMap="ResultVoMap">
        select * from kd_ys_sjfy where is_deleted = 0
        <if test="ysSjfy.xmId!=null and ysSjfy.xmId!=''">and XM_ID=#{ysSjfy.xmId}</if>
    </select>

</mapper>
