<?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.TbQwZbpbMrjlMapper">
    <update id="deleteByYwid">
        delete
        from tb_qw_zbpb_mrjl
        where pb_id = #{pbId}
          and pbzq_id = #{pbzqId}
    </update>

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


