<?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="io.renren.modules.app.dao.JkSelectDao">
	<select id="selectjk1" parameterType="io.renren.modules.app.entity.JkSelectEntity" resultType="io.renren.modules.app.entity.JkSelectEntity">
		 select ywpz.djrq,
             ywpz.djbh,
             CASE WHEN ywpz.djlx='01' THEN '单位缴款'
                  WHEN ywpz.djlx='03' THEN '个人缴款'
                  WHEN ywpz.djlx='04' THEN '公共收益分配'
                  else '未定' end djlx, 
             ywpz.je,
             ywpz.bank_code, 
             yhxx.yhmc,    
             ywpz.jsfs,     
             h_jsfs.billname, 
             ywpz.czybm,    
             ywpz.czyxm    
       from ywpz,
            h_jsfs,
            yhxx
      where h_jsfs.billcode = ywpz.jsfs
            AND ywpz.bank_code= yhxx.yhbm
            AND ywpz.djrq  between #{begdate} and #{enddate}
						and ywpz.djlx in ('01','02','03','04')   
            and ywpz.gzdbm=#{gzdbm}           
   order by ywpz.djrq
	</select>
	
	<select id="selectjk2" parameterType="io.renren.modules.app.entity.JkSelectEntity" resultType="io.renren.modules.app.entity.JkSelectEntity">
		 select ywpz.djrq,
             ywpz.djbh,
             CASE WHEN ywpz.djlx='01' THEN '单位缴款'
                  WHEN ywpz.djlx='03' THEN '个人缴款'
                  WHEN ywpz.djlx='04' THEN '公共收益分配'
                  else '未定' end djlx, 
             ywpz.je,
             ywpz.bank_code, 
             yhxx.yhmc,       
             ywpz.jsfs,     
             h_jsfs.billname, 
             ywpz.czybm,      
             ywpz.czyxm        
       from ywpz,
            h_jsfs,
            yhxx
      where h_jsfs.billcode = ywpz.jsfs
            AND ywpz.bank_code= yhxx.yhbm
            and ywpz.bank_code=#{yhbm}
            AND ywpz.djrq  between #{begdate} and #{enddate}
            and ywpz.djlx in ('01','02','03','04') 
            and ywpz.gzdbm=#{gzdbm}        
   order by ywpz.djrq
	</select>


</mapper>