<?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.qwzx.mapper.TbQwXfpbMrjlMapper">
    <update id="deleteByYwid">

                delete
                from tb_qw_xfpb_mrjl
                where pb_id = #{pbId}
                  and pbzq_id = #{pbzqId}

    </update>

    <select id="getMrjlByTime" resultType="com.mosty.base.model.entity.qwzx.TbQwXfpbMrjl">
        <![CDATA[
            select * from tb_qw_xfpb_mrjl a where (
                (
                        DATE_FORMAT(a.xfjssj,'%Y-%m-%d %H:%i:%s') > #{xfkssj}
                    and DATE_FORMAT(a.xfjssj,'%Y-%m-%d %H:%i:%s') < #{xfjssj}
                ) or (
                        DATE_FORMAT(a.xfjssj,'%Y-%m-%d %H:%i:%s') > #{xfkssj}
                    and DATE_FORMAT(a.xfjssj,'%Y-%m-%d %H:%i:%s') < #{xfjssj}
                )
            )
        ]]>
        <if test="pbid != null and pbid != ''">
            and a.pb_id != #{pbid}
        </if>
    </select>
</mapper>


