<?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.WxzjyjdrDao">

	<select id="selectdw" resultType="io.renren.modules.app.entity.XlkEntity">
		select dwmc,dwbm from sfdw
		where 1=1

	</select>

	<select id="selectyh" resultType="io.renren.modules.app.entity.XlkEntity">
		select yhmc,yhbm from yhxx
		where 1=1

	</select>

	<select id="selectjsfs" resultType="io.renren.modules.app.entity.XlkEntity">
		select billname,billcode from
		h_jsfs
		where 1=1

	</select>

	<insert id="insertbc" parameterType="io.renren.modules.app.entity.YwpzEntity">
		insert into
		ywpz(djbh,djlx,djrq,dwbm,cbwdbm,bank_Code,gzdbm,zph,je,czybm,czyxm,bz,pzz,pzh,
		flsh,jsfs,kjqj,syxm,dhbm,fpfs,pzzt,xgbm,jkfx,shrbm,shrxm,shrq)
		values(#{djbh},#{djlx},#{djrq},#{dwbm},#{cbwdbm},#{bankCode},
		#{gzdbm},#{zph},#{je},#{czybm},#{czyxm},#{bz},#{pzz},#{pzh},#{flsh},#{jsfs},#{kjqj},
		#{syxm},#{dhbm},#{fpfs},#{pzzt},#{xgbm},#{jkfx},#{shrbm},#{shrxm},#{shrq})
	</insert>

	<select id="selectgzd" parameterType="java.lang.String"
		resultType="Integer">
		select count(*) from gzdxx where gzdbm=#{id}

	</select>

	<select id="selectxtcs" parameterType="java.lang.String"
		resultType="Integer">
		select count(*) from xtcs where gzdbm=#{id}

	</select>

	<select id="selectdqkjqj" parameterType="java.lang.String"
		resultType="Integer">
		select count(*) from xtcs where dqkjqj=#{id}

	</select>

	<select id="selecthsqj" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="Integer">
		select count(*) from h_hsqj where kjqjmc=#{kjqj} and
		gzdbm=#{gzdbm}

	</select>

	<select id="selectsfyj" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="java.lang.String">
		select sfjz from h_hsqj where kjqjmc=#{kjqj} and
		gzdbm=#{gzdbm}

	</select>

	<select id="selectsysfyj" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="java.lang.String">
		select sfjz from h_hsqj where kjqjmc=#{kjqj} and
		gzdbm=#{gzdbm}

	</select>

	<select id="selectdwjk" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="Integer">
		SELECT count(*) from ywpz where kjqj =#{kjqj} and
		gzdbm=#{gzdbm} and djlx='01' and shzt='0'

	</select>

	<select id="selectgrjk" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="Integer">
		SELECT count(*) from ywpz where kjqj =#{kjqj} and
		gzdbm=#{gzdbm} and djlx='03' and shzt='0'

	</select>

	<select id="selectwftphjc" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="io.renren.modules.app.entity.YwpzEntity">
		select sfdw.dwbm,sfdw.dwmc,sfdw.zckje,t.YJYJJE
		from (select
		zhxx.dwbm,sum(dwze) YJYJJE
		from zhxx
		group by zhxx.dwbm) t,sfdw
		where
		t.dwbm=sfdw.dwbm
		and t.YJYJJE&lt;&gt;sfdw.zckje
		and sfdw.gzdbm=#{gzdbm}
	</select>

	<select id="selectyftphjc" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="io.renren.modules.app.entity.YwpzEntity">
		select
		zhxx.xmbm,zhxx.dhbm,zhxx.dhmc,zhxx.dwyjje,t.dwje,XM.Xmmc
		from (select
		dhbm,sum(dwje) dwje
		from fwxx
		group by dhbm)t,zhxx,XM
		where
		zhxx.dhbm=t.dhbm
		and ROUND(zhxx.dwyjje)&lt;&gt;ROUND(t.dwje)
		and
		zhxx.gzdbm=#{gzdbm}
		and zhxx.xmbm=XM.Xmbm;
	</select>

	<select id="selectgrwxzjphjc" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="io.renren.modules.app.entity.YwpzEntity">
		select
		zhxx.xmbm,zhxx.dhbm,zhxx.dhmc,zhxx.gryjje,t.grje,XM.Xmmc
		from (select
		dhbm,sum(grje) grje
		from fwxx
		group by dhbm)t,zhxx,XM
		where
		zhxx.dhbm=t.dhbm
		and zhxx.gryjje&lt;&gt;t.grje
		and zhxx.gzdbm=#{gzdbm}
		and zhxx.xmbm=XM.Xmbm;
	</select>

	<select id="selectpzfse" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="io.renren.modules.app.entity.HKmyeEntity">
		select kjqj,km hskmdm,sum(jfje) jfje,sum(dfje) dfje from
		h_pz where kjqj=#{kjqj} GROUP BY km
	</select>

	<select id="selectpzfse2" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="io.renren.modules.app.entity.HKmyeEntity">
		select
		y.hskmdm,y.kjqj,y.qcye,y.dfje,y.jfje,y.ljjfje,y.ljdfje,y.ztbm,k.kmsx
		from h_kmye y,h_km k where y.hskmdm=k.km and kjqj=#{kjqj} and
		k.ztbm=#{ztbm}
	</select>

	<insert id="updatekmye" parameterType="io.renren.modules.app.entity.HKmyeEntity">
		insert into
		h_kmye(hskmdm,kjqj,qcye,dfje,jfje,ljjfje,ljdfje,ztbm)
		values(#{hskmdm},#{kjqj},#{qcye},#{dfje},#{jfje},#{ljjfje},#{ljdfje},#{ztbm})
	</insert>

	<update id="updatekmye2" parameterType="io.renren.modules.app.entity.HKmyeEntity">
		update h_kmye set
		jfje=#{jfje},dfje=#{dfje},ljjfje=#{ljjfje},ljdfje=#{ljdfje} where
		hskmdm=#{hskmdm} and kjqj=#{kjqj}
	</update>

	<update id="updatekmye3" parameterType="io.renren.modules.app.entity.HKmyeEntity">
		update h_kmye set
		qcye=#{qcye},jfje=#{jfje},dfje=#{dfje},ljjfje=#{ljjfje},ljdfje=#{ljdfje}
		where
		hskmdm=#{hskmdm} and kjqj=#{kjqj}
	</update>

	<update id="updatextcs" parameterType="io.renren.modules.app.entity.YwpzEntity">
		update xtcs set
		dqkjqj=#{kjqj} where gzdbm=#{gzdbm}
	</update>

	<update id="updatehzt" parameterType="io.renren.modules.app.entity.YwpzEntity">
		update h_zt set
		kjqj=#{kjqj} where ztbm='0003'
	</update>

	<update id="updatehsqj" parameterType="io.renren.modules.app.entity.YwpzEntity">
		update h_hsqj set sfjz='1'
		where gzdbm=#{gzdbm} and kjqjmc=#{kjqj};
	</update>

	<update id="updatefyjhsqj" parameterType="io.renren.modules.app.entity.YwpzEntity">
		update h_hsqj set
		sfjz='0' where gzdbm=#{gzdbm} and kjqjmc=#{kjqj};
	</update>

	<update id="updatecwhsqj" parameterType="io.renren.modules.app.entity.YwpzEntity">
		update h_cwhsqj set
		sfjz='1' where ztbm='0003' and kjqjmc=#{kjqj};
	</update>

	<update id="updatecwfhsqj" parameterType="io.renren.modules.app.entity.YwpzEntity">
		update h_cwhsqj set
		sfjz='0' where ztbm='0003' and kjqjmc=#{kjqj};
	</update>

	<select id="selectcwsfyj" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="java.lang.String">
		select sfjz from h_cwhsqj where kjqjmc=#{kjqj} and
		ztbm='0003'

	</select>

	<select id="selectscwsfyj" parameterType="java.lang.String"
		resultType="java.lang.String">
		select sfjz from h_cwhsqj where kjqjmc=#{kjqj} and
		ztbm='0003'

	</select>

	<select id="selectpzjz" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="io.renren.modules.app.entity.HPzEntity">
		select * from h_pz where kjqj=#{kjqj} and sfjz='0'

	</select>

	<select id="selectcwkjqj" parameterType="java.lang.String"
		resultType="Integer">
		select count(*) from h_zt where kjqj=#{id}

	</select>

	<select id="selectkmsfcz" parameterType="io.renren.modules.app.entity.HKmyeEntity"
		resultType="Integer">
		select count(*) from h_kmye where hskmdm=#{hskmdm} and
		kjqj=#{kjqj}

	</select>

	<insert id="insertnewkm" parameterType="io.renren.modules.app.entity.HKmyeEntity">
		insert into
		h_kmye(hskmdm,kjqj,qcye,dfje,jfje,ljjfje,ljdfje,ztbm)
		values(#{hskmdm},#{kjqj},0,0,0,0,0,#{ztbm})
	</insert>

	<delete id="deleteqcye" parameterType="io.renren.modules.app.entity.YwpzEntity">
		delete from h_kmye where
		kjqj=#{kjqj}
	</delete>

	<update id="updatefse" parameterType="io.renren.modules.app.entity.HKmyeEntity">
		update h_kmye set
		dfje=#{dfje},jfje=#{jfje},ljdfje=#{ljdfje},ljjfje=#{ljjfje} where
		kjqj=#{kjqj} and hskmdm=#{hskmdm}
	</update>

	<select id="selectkmye" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="io.renren.modules.app.entity.HKmyeEntity">
		select * from h_kmye where kjqj=#{kjqj} and ztbm='0003'

	</select>

	<select id="selecthkm" resultType="io.renren.modules.app.entity.HKmEntity">
		select * from h_km where 1=1
		and ztbm='0002'
	</select>

	<select id="selelctkmyeo" parameterType="java.lang.String"
		resultType="io.renren.modules.app.entity.HKmyeEntity">
		select * from h_kmye where kjqj=#{id} GROUP BY hskmdm
	</select>

	<insert id="inserthhsqj" parameterType="java.lang.String">
		insert into
		h_hsqj(kjqjmc,sfjz,gzdbm) values(#{id},'0','0001')
	</insert>

	<delete id="deletehsqj" parameterType="java.lang.String">
		delete from h_hsqj where
		kjqjmc=#{id}
	</delete>

	<select id="selectywlcmzw" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="Integer">
		select count(*) from ywpz where kjqj=#{kjqj} and djlx in
		('01','03') and shzt='0'
	</select>

	<select id="selectzqmzw" parameterType="io.renren.modules.app.entity.YwpzEntity"
		resultType="Integer">
		select count(*) from ywpz y,sqwxzq s where y.djbh=s.jsdbh
		and y.kjqj=#{kjqj} and y.djlx='22' and s.sfjs='0'

	</select>

	<insert id="insertcwhsqj" parameterType="io.renren.modules.app.entity.YwpzEntity">
		insert into
		h_cwhsqj(hsqjbm,kjqjmc,sfjz,ztbm,banksfjz)
		values(#{hsqjbm},#{kjqj},'0','0003','0')
	</insert>

	<select id="queryhsqjbm" resultType="string">
		select max(hsqjbm+0) from
		h_cwhsqj
		order by hsqjbm desc
	</select>

	<delete id="deletecwhsqj" parameterType="java.lang.String">
		delete from h_cwhsqj
		where kjqjmc=#{id}
	</delete>

	<!-- 财务试算平衡 -->
	<select id="selectCWSSPH" parameterType="io.renren.modules.app.entity.HPzEntity"
		resultType="io.renren.modules.app.entity.HPzEntity">
		select kmdm,kmmc, kmsx,
		sum(jqcye) zjqcye,
		sum(dqcye) zdqcye,
		sum(jfje) zjfje,
		sum(dfje) zdfje,
		case kmsx when '0' then sum(jqcye)+
		sum(jfje) -sum(dfje) else 0 end jqmye,
		case kmsx when '1' then
		sum(dqcye)+ sum(dfje)- sum(jfje) else 0 end
		dqmye,jbh from (
		select p.km
		kmdm,k.kmmc,k.kmsx,0 jqcye ,0 dqcye, P.jfje,P.dfje ,'1' zz,k.jbh
		from
		h_pz P ,h_KM K
		where (p.km=k.km) and p.kjqj=#{kjqj} and (k.ztbm='0002')
		and
		(p.ztbm='0002')
		union all
		select y.hskmdm kmdm ,k.kmmc,k.kmsx, case
		k.kmsx when '1' then 0 else y.qcye
		end jqcye,
		case k.kmsx when '1' then
		y.qcye else 0 end dqcye ,0 jfje,0 dfje ,'1'
		zz,k.jbh from h_kmye y,h_km
		k
		where (y.hskmdm=k.km) and (y.kjqj=#{kjqj}) and (k.ztbm='0002') and
		(y.ztbm='0002')
		) a
		group by kmdm,kmmc,kmsx,zz order by kmdm
	</select>

	<select id="selectzhxx" resultType="io.renren.modules.app.entity.ZhxxEntity">
		select dhbm from zhxx WHERE
		gzdbm='0001' and ndjx='0'
	</select>

	<select id="selectxtcs1" resultType="io.renren.modules.app.entity.XtcsEntity">
		select dqll,hqll from xtcs
		where gzdbm='0001'
	</select>

	<select id="selectndsj" resultType="Integer">
		SELECT count(*) count FROM
		H_KJND WHERE (GZDBM='0001') AND (now() BETWEEN NTQSRQ AND NTZZRQ)
	</select>

	<select id="selectkjnd" resultType="io.renren.modules.app.entity.YwpzEntity">
		SELECT ntqsrq beginrq,ntzzrq
		endrq FROM H_KJND WHERE (GZDBM='0001') AND (now() BETWEEN NTQSRQ AND
		NTZZRQ)
	</select>

	<select id="selectfwxxbydh" parameterType="java.lang.String"
		resultType="io.renren.modules.app.entity.FwxxEntity">
		select dhbm,fwbm,mphm,xm,ncye,dqye from fwxx where sfsc='1'
		and dhbm=#{id}
	</select>

	<select id="selectgjlastday" parameterType="java.lang.String"
		resultType="io.renren.modules.app.entity.HPzEntity">
		SELECT LAST_DAY(str_to_date(#{id},'%Y-%m')) pzrq from DUAL
	</select>

	<select id="queryByCount" parameterType="java.lang.String"
		resultType="java.lang.String">
		select max(substr(djbh,17,4)) from ywpz where
		substr(kjqj,1,7)=substr(#{id},1,7) and djlx='10'

	</select>

	<select id="selectllxx" parameterType="java.util.HashMap"
		resultType="io.renren.modules.app.entity.LlbEntity">
		select * from llb
		where (( begdate &lt;=#{begtime} and
		enddate
		&gt;=#{endtime})
		or ( begdate &gt;#{begtime} and enddate &lt;
		#{endtime})
		or (
		begdate&gt;#{begtime} and enddate &gt;= #{endtime})
		or (
		begdate &lt;=
		#{begtime} and enddate &lt;= #{endtime}))
		and (lltype='1')
		and (sfty='0')
		order by begdate
	</select>

	<select id="selectdwbydh" parameterType="java.lang.String"
		resultType="io.renren.modules.app.entity.ZhxxEntity">
		select dwbm from xm where xmbm=(select xmbm from zhxx where
		dhbm=#{id})
	</select>

	<insert id="insertywpzjx" parameterType="io.renren.modules.app.entity.YwpzEntity">
		insert into
		ywpz(djbh,djlx,djrq,dwbm,cbwdbm,jsfs,kjqj,bank_code,gzdbm,je,czybm,czyxm,bz)
		values(#{djbh},'10',date_format(now(),
		'%Y-%m-%d'),#{dwbm},'0001','30',#{kjqj},'00010010','0001',0,#{czybm},#{czyxm},'批量计算利息')
	</insert>

	<update id="updatedf" parameterType="java.lang.String">
		update ywpzmx set df=(case
		when ISNULL(bjje) then 0 else bjje END) WHERE
		ywpzmx.fwbm= #{id} and
		jdf='0'
	</update>

	<update id="updatejf" parameterType="java.lang.String">
		update ywpzmx set jf=(case
		when ISNULL(bjje) then 0 else bjje END) WHERE
		ywpzmx.fwbm= #{id} and
		jdf='1'
	</update>

	<select id="selectsumjdf" parameterType="java.util.HashMap"
		resultType="io.renren.modules.app.entity.HPzEntity">
		select sum(jf) jf,sum(df) df,c.rzrq rzrq
		from (select
		b.djbh,a.jf,a.df, b.djrq RZRQ
		FROM ywpzmx a,ywpz b
		WHERE a.djbh=b.djbh
		and (b.djrq BETWEEN #{begtime} AND #{endtime})
		AND (a.fwbm=#{id}) and
		b.DjLX &lt;&gt; '23' and (b.pzzt='1' or
		b.pzzt='2')) c
		GROUP BY rzrq
	</select>

	<select id="selectcjc" parameterType="java.util.HashMap"
		resultType="io.renren.modules.app.entity.YwpzEntity">
		select (case
		when ISNULL(sum(a.bjje)) then 0 else
		sum(a.bjje) END)
		ncje
		FROM ywpzmx a,ywpz b
		WHERE a.djbh=b.djbh and
		(b.djrq BETWEEN #{begtime} AND #{endtime})
		AND (a.fwbm= #{id}) and
		(a.jdf='0' and a.bjje&lt;0)
		and b.DjLX &lt;&gt; '23' and (b.pzzt='1' or
		b.pzzt='2')
	</select>

	<select id="selectzqcl" parameterType="java.util.HashMap"
		resultType="io.renren.modules.app.entity.YwpzEntity">
		select (case
		when ISNULL(sum(a.bjje)) then 0 else
		sum(a.bjje) END)
		nzje
		FROM ywpzmx a,ywpz b
		WHERE a.djbh=b.djbh and
		(b.djrq BETWEEN #{begtime} AND #{endtime})
		AND (a.fwbm= #{id}) and
		(a.jdf='1' and a.bjje&gt;0)
		and b.DjLX &lt;&gt; '23' and (b.pzzt='1' or
		b.pzzt='2')
	</select>

	<insert id="insertywpzjiexi" parameterType="io.renren.modules.app.entity.YwpzmxEntity">
		insert into
		ywpzmx(djbh,dhbm,fwbm,bjje,lxje,jdf)
		values(#{djbh},#{dhbm},#{fwbm},#{bjje},#{lxje},#{jdf})
	</insert>

	<delete id="deleteywpzbyid" parameterType="java.lang.String">
		delete from ywpz where
		djbh=#{id}
	</delete>

	<update id="updateywpzbyid" parameterType="io.renren.modules.app.entity.YwpzEntity">
		update ywpz set
		je=#{je} where djbh=#{djbh}
	</update>

	<select id="selectzhxx1" parameterType="java.lang.String"
		resultType="io.renren.modules.app.entity.ZhxxEntity">
		select * from zhxx where dhbm=#{id}
	</select>

	<update id="updateZhxx" parameterType="io.renren.modules.app.entity.ZhxxEntity">
		update zhxx set
		ljlx=#{ljlx},ndjx=#{ndjx} where dhbm=#{dhbm}
	</update>

	<select id="queryByPagePLJX" resultType="io.renren.modules.app.entity.ZhxxEntity">
		select
		s.dwmc,x.xmmc,z.dhmc,z.dhbm from zhxx z,xm x,sfdw s WHERE
		z.gzdbm='0001' and z.ndjx='0' and z.xmbm=x.xmbm and x.dwbm=s.dwbm
	</select>

	<select id="selectfwxx2" resultType="io.renren.modules.app.entity.FwxxEntity">
		select
		dhbm,fwbm,mphm,xm,ncye,dqye from fwxx where sfsc='1'
		and gzdbm='0001'
	</select>

	<delete id="deletegryjx">
		delete from h_gryjx where gzdbm='0001'
	</delete>

	<insert id="insertgryjx" parameterType="io.renren.modules.app.entity.HGryjxEntity">
		insert into
		h_gryjx(gzdbm,fwbm,dhbm,xm,mphm,dqjs,hqjs,lx,jxrq,ncye,dqye,dqlx,hqlx)
		values(#{gzdbm},#{fwbm},#{dhbm},#{xm},#{mphm},#{dqjs},#{hqjs},#{lx},#{jxrq},#{ncye},#{dqye},#{dqlx},#{hqlx})
	</insert>

	<select id="queryByPageYJLXFW" resultType="io.renren.modules.app.entity.HGryjxEntity">
		select * from h_gryjx
		where 1=1
	</select>

	<select id="queryByPageYJLXLZ" resultType="io.renren.modules.app.entity.HGryjxEntity">
		select
		h.dhbm,z.dhmc,SUM(h.lx) lx,SUM(h.dqjs) dqjs,SUM(h.hqjs)
		hqjs,SUM(h.dqlx) dqlx,SUM(h.hqlx) hqlx,SUM(h.ncye) ncye,SUM(h.dqye)
		dqye from h_gryjx h,zhxx z where h.dhbm=z.dhbm GROUP BY dhbm

	</select>

	<select id="selectfzhsmx" parameterType="java.lang.String"
		resultType="io.renren.modules.app.entity.YwpzEntity">
		select xmbm,dffse,djbh from fzhsmx where gjkjqj=#{id} and
		djlx='01'
	</select>

	<select id="selectfffff" parameterType="java.lang.String"
		resultType="io.renren.modules.app.entity.YwpzEntity">
		select z.xmbm,y.je dffse from yjmx y,zhxx z where
		y.dhbm=z.dhbm and y.djbh=#{id}
	</select>

	<select id="selectfzhsmx03" parameterType="java.lang.String"
		resultType="io.renren.modules.app.entity.YwpzEntity">
		select xmbm,dffse,djbh from fzhsmx where gjkjqj=#{id} and
		djlx='03'
	</select>

	<insert id="insertfzhsye" parameterType="io.renren.modules.app.entity.YwpzEntity">
		insert into
		fzhsye(gjkjqj,xmbm,djlx,qcye,jffse,dffse,qmye,zqlx)values(#{gjkjqj},#{xmbm},#{djlx},#{qcye},#{jffse},#{dffse},#{qmye},#{zqlx})
	</insert>

	<insert id="insertfzhsyeList">
		insert into fzhsye
		(
		gjkjqj,xmbm,djlx,qcye,jffse,dffse,qmye,zqlx
		)
		values
		<foreach item="item" index="index" collection="list"
			separator=",">
			(
			#{item.gjkjqj},
			#{item.xmbm},
			#{item.djlx},
			#{item.qcye},
			#{item.jffse},
			#{item.dffse},
			#{item.qmye},
			#{item.zqlx}
			)
		</foreach>
	</insert>

	<insert id="updatefzhsye2" parameterType="io.renren.modules.app.entity.YwpzEntity">
		update fzhsye set qcye=#{qcye},jffse=#{jffse},dffse=#{dffse},qmye=#{qmye}
		where gjkjqj=#{gjkjqj} and xmbm=#{xmbm} and djlx=#{djlx}
	</insert>

	<!-- <update id="updatefzhsye2List">
		<foreach item="item" index="index" collection="list"
			separator=";">
			update fzhsye set qcye=#{item.qcye},jffse=#{item.jffse},dffse=#{item.dffse},qmye=#{item.qmye}
			where gjkjqj=#{item.xmbm} and xmbm=#{item.xmbm} and djlx=#{item.djlx}
		</foreach>
	</update> -->
	
	<update id="updatefzhsye2List" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            UPDATE fzhsye
            <set>
                    qcye = #{item.qcye},
                    jffse=#{item.jffse},
                    dffse=#{item.dffse},
                    qmye=#{item.qmye}
            </set>
            WHERE gjkjqj=#{item.gjkjqj} and xmbm=#{item.xmbm} and djlx=#{item.djlx}
         </foreach>
     </update>

	<select id="selectfzhsye" parameterType="java.lang.String"
		resultType="io.renren.modules.app.entity.YwpzEntity">
		select * from fzhsye where gjkjqj=#{id} and djlx='01'
	</select>

	<select id="selectfzhsye03" parameterType="java.lang.String"
		resultType="io.renren.modules.app.entity.YwpzEntity">
		select * from fzhsye where gjkjqj=#{id} and djlx='03'
	</select>

	<select id="selectxmbm555" resultType="io.renren.modules.app.entity.YwpzEntity">
		select xmbm from xm where
		1=1
	</select>

	<delete id="deletefzhsye" parameterType="java.lang.String">
		delete from fzhsye where gjkjqj=#{id}
	</delete>

	<update id="updatefzhsye" parameterType="java.lang.String">
		update fzhsye set jffse=0.0,dffse=0.0,qmye=0.0 where gjkjqj=#{id}
	</update>
	
	<update id="deletefzhsmxgrdw" parameterType="java.lang.String">
		update fzhsye set jffse=0,dffse=0,qmye=0 where gjkjqj=#{id} and djlx in('01','03')
	</update>
	
	<delete id="deletefzhsmxgrdwnext" parameterType="java.lang.String">
		delete from fzhsye where djlx in ('01','03') and gjkjqj=#{id}
	</delete>
	
	<select id="selectdyfs" parameterType="java.lang.String"
		resultType="io.renren.modules.app.entity.YwpzEntity">
		select * from fzhsmx where gjkjqj=#{id} and djlx in('01','03')
	</select>
	
	<select id="selectdyfshs" parameterType="java.lang.String"
		resultType="io.renren.modules.app.entity.YwpzEntity">
		select * from fzhsye where gjkjqj=#{id} and djlx in('01','03')
	</select>

</mapper>