92 lines
3.9 KiB
XML
92 lines
3.9 KiB
XML
|
|
<?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="ProxyerBill">
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<insert id="insertProxyerBill" parameterType="ProxyerBill">
|
||
|
|
insert into proxyerBill (proxyerBillId,proxyer,created,payedFee,payedTime,payedMethod,memo,finanPic,status,checker,checkDesc,checkDate)
|
||
|
|
values (#{proxyerBillId},#{proxyer},current_timestamp,#{payedFee},#{payedTime},#{payedMethod},#{memo},#{finanPic},#{status},#{checker},#{checkDesc},#{checkDate})
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateProxyerBill" parameterType="ProxyerBill">
|
||
|
|
update proxyerBill set proxyer=#{proxyer},created=#{created},payedFee=#{payedFee},payedTime= #{payedTime},payedMethod= #{payedMethod}
|
||
|
|
,memo=#{memo},finanPic=#{finanPic},status=#{status},checker=#{checker},checkDesc=#{checkDesc},checkDate=#{checkDate}
|
||
|
|
where proxyerBillId = #{proxyerBillId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<select id="getProxyerBillById" parameterType="java.lang.Integer" resultType="ProxyerBill">
|
||
|
|
select proxyerBillId,proxyer,created,payedFee,payedTime,payedMethod,memo,finanPic,status,checker,checkDesc,checkDate from proxyerBill where proxyerBillId = #{proxyerBillId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getSeqProxyerBillId" resultType="Integer" useCache="false" flushCache="true">
|
||
|
|
SELECT nextval('seq_proxyerbillid')
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getProxyerBills" parameterType="java.util.Map" resultType="java.util.Map">
|
||
|
|
select p.proxyerBillId,p.proxyer,a.truename proxyername,to_char(p.created,'yyyy-MM-dd HH24:MI:SS') created,
|
||
|
|
|
||
|
|
p.payedFee,to_char(p.payedTime,'yyyy-MM-dd HH24:MI:SS') payedTime ,p.payedMethod,p.memo,p.finanPic,
|
||
|
|
p.status,case p.status when 2 then '待审核' when 3 then '已完成' when -1 then '检查驳回' end as step
|
||
|
|
from proxyerBill p inner join
|
||
|
|
admin a on a.adminid=p.proxyer
|
||
|
|
<if test="proxyerId!=null">
|
||
|
|
and proxyer = #{proxyerId}
|
||
|
|
</if>
|
||
|
|
<if test="statuss!=null">
|
||
|
|
and p.status in
|
||
|
|
<foreach collection="statuss" item="item" separator="," close=")" open="(">
|
||
|
|
|
||
|
|
#{item}
|
||
|
|
|
||
|
|
</foreach>
|
||
|
|
</if>
|
||
|
|
order by proxyerBillId desc
|
||
|
|
<if test="pageSize!=null">
|
||
|
|
limit #{pageSize}
|
||
|
|
</if>
|
||
|
|
<if test="offset!=null">
|
||
|
|
offset #{offset}
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getProxyerBillsCount" parameterType="java.util.Map" resultType="java.lang.Integer">
|
||
|
|
select count(proxyerBillId) from proxyerBill where 1=1
|
||
|
|
<if test="_parameter!=null">
|
||
|
|
and proxyer = #{proxyerId}
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="statuss!=null">
|
||
|
|
and status in
|
||
|
|
<foreach collection="statuss" item="item" separator="," close=")" open="(">
|
||
|
|
#{item}
|
||
|
|
|
||
|
|
</foreach>
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getProxyerBillDtoById" parameterType="java.lang.Integer" resultType="java.util.Map">
|
||
|
|
select p.proxyerBillId,p.proxyer,a.truename proxyername,to_char(p.created,'yyyy-MM-dd HH24:MI:SS') created,
|
||
|
|
|
||
|
|
p.payedFee,to_char(p.payedTime,'yyyy-MM-dd HH24:MI:SS') payedTime ,p.payedMethod,p.memo,p.finanPic,
|
||
|
|
p.status,case p.status when 2 then '待审核' when 3 then '已完成' when -1 then '检查驳回' end as step,
|
||
|
|
p.checkdesc,to_char(p.checkdate,'yyyy-MM-dd HH24:MI:SS') checkdate,p.checker,b.truename checkername
|
||
|
|
from proxyerBill p inner join
|
||
|
|
admin a on a.adminid=p.proxyer
|
||
|
|
left join admin b on p.checker=b.adminid
|
||
|
|
where proxyerBillId = #{proxyerBillId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="getProxyerBillPayedFeeCount" parameterType="java.util.Map" resultType="java.lang.Double">
|
||
|
|
select sum(payedFee) fee from proxyerbill where proxyer=#{proxyerId} and status=3
|
||
|
|
<!-- <if test="startTime!=null">
|
||
|
|
<![CDATA[
|
||
|
|
and payedtime < #{startTime}
|
||
|
|
]]>
|
||
|
|
</if> -->
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|