<?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.rhzf.ryJwrk.mapper.RyJwrkMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="ryJwrkResultMap" type="org.springblade.modules.rhzf.ryJwrk.entity.RyJwrkEntity">
        <result column="id" property="id"/>
        <result column="fw_id" property="fwId"/>
        <result column="ry_lb" property="ryLb"/>
        <result column="ry_xs" property="ryXs"/>
        <result column="ry_mz" property="ryMz"/>
        <result column="ry_xb" property="ryXb"/>
        <result column="ry_csrq" property="ryCsrq"/>
        <result column="ry_gjdq" property="ryGjdq"/>
        <result column="ry_fwcs" property="ryFwcs"/>
        <result column="ry_csdz" property="ryCsdz"/>
        <result column="ry_dh" property="ryDh"/>
        <result column="ry_zjlb" property="ryZjlb"/>
        <result column="ry_zjhm" property="ryZjhm"/>
        <result column="ry_zjqsrq" property="ryZjqsrq"/>
        <result column="ry_zjjzrq" property="ryZjjzrq"/>
        <result column="ry_qzlb" property="ryQzlb"/>
        <result column="ry_qzhm" property="ryQzhm"/>
        <result column="ry_lhsy" property="ryLhsy"/>
        <result column="ry_rzrq" property="ryRzrq"/>
        <result column="ry_lkrq" property="ryLkrq"/>
        <result column="ry_ts_lb" property="ryTsLb"/>
        <result column="ry_ts_jtqk" property="ryTsJtqk"/>
        <result column="dw_mc" property="dwMc"/>
        <result column="dw_lb" property="dwLb"/>
        <result column="dw_dz" property="dwDz"/>
        <result column="dw_xz" property="dwXz"/>
        <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>


    <select id="selectRyJwrkPage" resultMap="ryJwrkResultMap">
        select * from rhzf_ry_jwrk where is_deleted = 0
    </select>


    <select id="exportRyJwrk" resultType="org.springblade.modules.rhzf.ryJwrk.excel.RyJwrkExcel">
        SELECT * FROM rhzf_ry_jwrk ${ew.customSqlSegment}
    </select>

    <update id="updateRy">
        update jdrh.rhzf_ry_jwrk set
        ry_mz = #{ryMz},
        ry_xb = #{ryXb},
        ry_csrq = #{ryCsrq},
        ry_dh = #{ryDh},
        vx = #{vx},
        ry_zjhm = #{ryZjhm},
        dw_mc = #{dwMc},
        dw_xz = #{dwXz},
        zjxy = #{zjxy},
        zjxy_dm = #{zjxyDm},
        update_user = #{updateUser},
        update_time = now(),
        bz = #{bz}
        where id = #{id}
    </update>

    <update id="jwrkZx" parameterType="org.springblade.modules.rhzf.ryJwrk.entity.RyJwrkEntity">
        UPDATE jdrh.rhzf_ry_jwrk
        <set>
            is_deleted = 1,
            update_time = now(),
            zxyy = #{zxyy},
            zxrq = #{zxrq},
            qwdzssxq = #{qwdzssxq},
            qwdzxz = #{qwdzxz},
        </set>
        WHERE id = #{id}
    </update>
</mapper>
