<?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="com.mosty.yjzl.mapper.TbZdyFgrwMapper">
    <select id="getLqfgrw" resultType="com.mosty.base.model.entity.yjzl.zddw.TbZdyFgrw">
        SELECT fgrw.* FROM tb_zdy_fgrwlq rwlq LEFT JOIN tb_zdy_fgrw fgrw ON rwlq.fgrwid = fgrw.id
        where    fgrw.xt_scbz = '0'
        <if test="dto.fgRwmc != null and dto.fgRwmc != ''">
            and fgrw.fg_rwmc like concat('%',#{dto.fgRwmc},'%')
        </if>
        <if test="dto.ssbmdm != null and dto.ssbmdm != ''">
            and fgrw.ssbmdm like concat(#{dto.ssbmdm},'%')
        </if>
        <if test="dto.xfbmdm != null and dto.xfbmdm != ''">
            and fgrw.xfbmdm like concat(#{dto.xfbmdm},'%')
        </if>
        <if test="dto.fgrwlqrid != null and dto.fgrwlqrid != ''">
            and rwlq.fgrwlqrid = #{dto.fgrwlqrid}
        </if>
        order by rwlq.xt_cjsj desc
    </select>

    <select id="selectXfbbByFzrSfzh" resultType="com.mosty.base.model.entity.qwzx.TbQwXfbb">
        SELECT * FROM mosty_qwgl.tb_qw_xfbb xfbb WHERE xfbb.xt_scbz = '0'
        AND xfbb.fzr_sfzh =  #{sfzh} AND xfbb.xfrq = #{xfrq} AND xfbb.bbzt='0'
    </select>

</mapper>
