<?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.mdjfxj.ryXj.mapper.RyXjMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="ryXjResultMap" type="org.springblade.modules.mdjfxj.ryXj.entity.RyXjEntity">
        <result column="id" property="id"/>
        <result column="jf_id" property="jfId"/>
        <result column="xm" property="xm"/>
        <result column="xb" property="xb"/>
        <result column="sfzh" property="sfzh"/>
        <result column="lxdh" property="lxdh"/>
        <result column="lb" property="lb"/>
        <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"/>
        <result column="ryzp" property="ryzp"/>
        <result column="sflk" property="sflk"/>
        <result column="qmzp" property="qmzp"/>
        <result column="hfzp" property="hfzp"/>
    </resultMap>


    <select id="selectRyXjPage" resultMap="ryXjResultMap">
        select * from mdjf_ry_xj where is_deleted = 0
    </select>


    <select id="exportRyXj" resultType="org.springblade.modules.mdjfxj.ryXj.excel.RyXjExcel">
        SELECT * FROM mdjf_ry_xj ${ew.customSqlSegment}
    </select>

    <select id="getRyByMdId" resultType="org.springblade.modules.mdjfxj.ryXj.entity.RyXjEntity">
        SELECT
            *
        FROM
            mdjf_ry_xj
        WHERE
            is_deleted = 0
          AND jf_id = #{id}
    </select>

    <update id="updateAllQmzp" parameterType="java.util.Map">
        <foreach collection="qmzpMap" item="qmzp" index="key" separator=";">
            UPDATE mdjf_ry_xj
            SET
            qmzp = #{qmzp}
            WHERE
            id :: text = #{key}
        </foreach>
    </update>

    <update id="updateAllRyzp" parameterType="java.util.Map">
        <foreach collection="ryzpMap" item="ryzp" index="key" separator=";">
            UPDATE mdjf_ry_xj
            SET
            ryzp = #{ryzp}
            WHERE
            id :: text = #{key}
        </foreach>
    </update>
</mapper>
