<?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.unis.base.server.dao.QyxypjDao">

    <select id="queryPageList" resultType="com.unis.base.server.entity.QyxypjDcDO">
        select * from qyxypjdc
        <where>
            <if test="ztmc != null and ztmc != ''">
                and ztmc like '%${ztmc}%'
            </if>
            <if test="pjnd != null and pjnd != ''">
                and pjnd = #{pjnd}
            </if>
            <if test="pjjg != null and pjjg != ''">
                and pjjg = #{pjjg}
            </if>
            <if test="fsks != null and fsks != ''">
                and cast(xydf as SIGNED) &gt;= cast(#{fsks} as SIGNED)
            </if>
            <if test="fsjs != null and fsjs != ''">
                and cast(xydf as SIGNED) &lt;= cast(#{fsjs} as SIGNED)
            </if>
        </where>
        order by cast(pjnd as SIGNED) desc ,pjjg desc, cast(xydf  as SIGNED) desc
    </select>
    <update id="updateBatch" parameterType="com.unis.base.server.entity.QyxypjDcDO">
        update qyxypjdc
        <set>
            <if test="pjmc != null and pjmc != ''">
                pjmc = #{pjmc},
            </if>
            <if test="pjrq != null and pjrq != ''">
                pjrq = #{pjrq},
            </if>
            <if test="pjnd != null and pjnd != ''">
                pjnd = #{pjnd},
            </if>
            <if test="pjyxq != null and pjyxq != ''">
                pjyxq = #{pjyxq},
            </if>
            <if test="fbsj != null and fbsj != ''">
                fbsj = #{fbsj},
            </if>
            <if test="pjjgqc != null and pjjgqc != ''">
                pjjgqc = #{pjjgqc},
            </if>
            <if test="pjjgtyshxydm != null and pjjgtyshxydm != ''">
                pjjgtyshxydm = #{pjjgtyshxydm},
            </if>
        </set>
        where zt = '待提交'
    </update>
</mapper>
