<?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.CcsstzjsmxDao'>

    <select id="queryBySbnfAndOrgCode" resultType="com.unis.base.server.entity.CcsstzjsmxDO">
        select * from ccsstzjsmx where sbnf = #{sbnf} and org_code = #{orgCode} and sbzt = '1'
    </select>
    <select id="queryPageList" resultType="com.unis.base.common.vo.CcsstzjsmxVO">
        select * from ccsstzjsmx
        <where>
            <if test="sbnf != null and sbnf != ''">
                and sbnf = #{sbnf}
            </if>
            <if test="orgCode != null and orgCode != ''">
                and org_code like = #{orgCode}
            </if>
        </where>
        order by sbnf desc
    </select>
    <select id="queryLastYearDataForList" resultType="com.unis.base.server.entity.CcsstzjsmxDO">
        select *
        from ccsstzjsmx
        where sbnf = #{sbnf}
          and org_code like concat(#{orgCode}, '%')
          and sbzt = '1' order by org_code asc
    </select>
</mapper>
