80aae306f97c827d4421cba11394f7ce644e718f.svn-base 1.89 KB
<?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.thinkgem.jeesite.modules.reg.dao.ywpjxt.YwpjDao">
	
	<!-- 根据操作人员Id获取ywpj -->
	<select id="getYwpjByUserId" resultType="ywpj">
		select * from ywpj y where y.userId = #{userId} and y.slzt = 2 order by y.sqrq desc
	</select>

	<!-- 更新mycd -->
	<update id="updatePjmycd">
		update ywpj set slzt = '3', mycd = #{mycd}, pjfs = #{pjfs} where pjId = #{pjId}
	</update>

	<!-- 根据Id获取ywpj -->
	<select id="getYwpjByPjId" resultType="ywpj">
		select * from ywpj y where pjId = #{pjId}
	</select>

	<insert id="addYwpj">
		insert into ywpj(pjId, ywh, djxlbm, djxlmc, sqr, zjhm, userId, sqrq, slzt) values
			(#{pjId}, #{ywh}, #{djxlbm}, #{djxlmc}, #{sqr}, #{zjhm}, #{userId}, #{sqrq}, #{slzt})
	</insert>
	
	<!-- 评价状态变更  业务办理时 slzt=1 提交业务时slzt=2 返回时slzt=0 -->
	<update id="updatePjslzt">
		update ywpj set slzt = #{slzt} where ywh = #{ywh}
	</update>
	
	<select id="getYwpjIdByYwh" resultType="String">
		select pjId from ywpj where ywh = #{ywh}
	</select>
	
	<!-- 获取所有的userId -->
	<select id="getAllUserId" resultType="String">
		select userId from cwuser where yxbz = '1'
	</select>
	
	<!-- 获取评价数据 -->
	<select id="getPjfsByUserId" resultType="Integer">
		select count(*) from ywpj y 
		where y.userId = #{userId} 
		and y.mycd = #{mycd} 
		and sqrq &gt; to_date(#{qssj},'yyyy-MM') 
		and sqrq &lt; to_date(#{jssj},'yyyy-MM')  
		and y.slzt = '3'
	</select>
	
	<!-- 获取当前用户所有的评价信息 -->
	<select id="findList" resultType="Ywpj">
		select * from ywpj 
		where 1 = 1
		<if test="userId != null and userId != ''">
			and userid = #{userId}
		</if>
		<if test="slzt != null and slzt != ''">
			and slzt = #{slzt}
		</if>
		order by ywh desc
	</select>
</mapper>