|
|
@@ -481,8 +481,16 @@
|
|
|
<if test="type != null">
|
|
|
and a.type= #{type}
|
|
|
</if>
|
|
|
- <if test="checkNo != null or username != null" >
|
|
|
- and (a.check_no like concat('%',#{checkNo},'%') or tm.buyer_name like concat('%',#{username},'%'))
|
|
|
+ <if test="checkNo != null " >
|
|
|
+ <if test="expenseMain ==0">
|
|
|
+ and mea.check_no like concat('%',#{checkNo},'%')
|
|
|
+ </if>
|
|
|
+ <if test="expenseMain ==1">
|
|
|
+ and a.check_no like concat('%',#{checkNo},'%')
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="username != null" >
|
|
|
+ and tm.buyer_name like concat('%',#{username},'%')
|
|
|
</if>
|
|
|
<if test="startTime !=null and endTime !=null">
|
|
|
and a.create_time between #{startTime} and #{endTime}
|
|
|
@@ -550,8 +558,11 @@
|
|
|
<if test="type != null">
|
|
|
and a.type= #{type}
|
|
|
</if>
|
|
|
- <if test="checkNo != null or username != null" >
|
|
|
- and (a.check_no like concat('%',#{checkNo},'%') or tm.buyer_name like concat('%',#{username},'%'))
|
|
|
+ <if test="checkNo != null " >
|
|
|
+ and a.check_no like concat('%',#{checkNo},'%')
|
|
|
+ </if>
|
|
|
+ <if test="username != null" >
|
|
|
+ and tm.buyer_name like concat('%',#{username},'%')
|
|
|
</if>
|
|
|
<if test="startTime !=null and endTime !=null">
|
|
|
and a.create_time between #{startTime} and #{endTime}
|
|
|
@@ -613,6 +624,12 @@
|
|
|
<if test="type != null">
|
|
|
and a.type= #{type}
|
|
|
</if>
|
|
|
+ <if test="checkNo != null " >
|
|
|
+ and a.check_no like concat('%',#{checkNo},'%')
|
|
|
+ </if>
|
|
|
+ <if test="username != null" >
|
|
|
+ and tm.buyer_name like concat('%',#{username},'%')
|
|
|
+ </if>
|
|
|
<if test="startTime !=null and endTime !=null">
|
|
|
and a.create_time between #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
@@ -718,11 +735,13 @@
|
|
|
</select>
|
|
|
|
|
|
<sql id="mainAllSql">
|
|
|
- select b.id,b.check_no,b.total_amount,b.order_no,o.contract_no,b.aname,b.apply_dep,b.pay_dep,
|
|
|
+ select b.id,b.check_no,b.total_amount,b.order_no,o.contract_no,b.aname,b.apply_dep,b.pay_dep,b.real_amount,
|
|
|
+ date_format(b.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,
|
|
|
dep.name applyDepName,dep2.name payDepName, b.remarks,b.eaaid ,eap.name ,eap.bank ,eap.accounts ,b.status,b.process_status,
|
|
|
c.id sonId,c.total_amount sonAmount,c.`type` ,c.type_other ,c.user_names ,c.release_start ,c.release_end ,
|
|
|
- c.district_name districtName,c.user_names userNames,
|
|
|
- d.id detId,d.`type` detType,d.amount,d.real_amount realAmount ,d.start_district ,d.end_district
|
|
|
+ c.district_name districtName,c.user_names userNames,c.secondary_type ,c.secondary_type_other,c.attachment_url,
|
|
|
+ d.id detId,d.`type` detType,d.amount,d.real_amount realAmount ,d.start_district ,d.end_district,d.vehicle,d.vehicle_other,
|
|
|
+ d.pay_type ,d.invoice_type ,d.invoice_no,d.payer_name ,d.open_bank ,d.bank_accounts ,d.open_bank_address
|
|
|
from expense_relationship a left join expense_account b on a.id =b.id
|
|
|
left join department dep on b.apply_dep =dep.id left join department dep2 on b.pay_dep =dep2.id
|
|
|
left join t_order_new o on b.order_no =o.order_no left join expense_account_private eap on b.eaaid =eap.id
|
|
|
@@ -739,6 +758,7 @@
|
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
|
<result column="check_no" jdbcType="VARCHAR" property="checkNo" />
|
|
|
<result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
|
|
|
+ <result column="real_amount" jdbcType="DECIMAL" property="realAmount" />
|
|
|
<result column="order_no" jdbcType="VARCHAR" property="orderNo" />
|
|
|
<result column="contract_no" jdbcType="VARCHAR" property="contractNo" />
|
|
|
<result column="aname" jdbcType="VARCHAR" property="aname" />
|
|
|
@@ -762,6 +782,9 @@
|
|
|
<result column="sonAmount" jdbcType="DECIMAL" property="totalAmount" />
|
|
|
<result column="type" jdbcType="INTEGER" property="type" />
|
|
|
<result column="type_other" jdbcType="VARCHAR" property="typeOther" />
|
|
|
+ <result column="secondary_type" jdbcType="INTEGER" property="secondaryType" />
|
|
|
+ <result column="secondary_type_other" jdbcType="INTEGER" property="secondaryTypeOther" />
|
|
|
+ <result column="attachment_url" jdbcType="INTEGER" property="attachmentUrl" />
|
|
|
<result column="user_names" jdbcType="VARCHAR" property="userNames" />
|
|
|
<result column="release_start" jdbcType="VARCHAR" property="releaseStart" />
|
|
|
<result column="release_end" jdbcType="VARCHAR" property="releaseEnd" />
|
|
|
@@ -775,14 +798,24 @@
|
|
|
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
|
|
<result column="start_district" jdbcType="VARCHAR" property="startDistrict" />
|
|
|
<result column="end_district" jdbcType="VARCHAR" property="endDistrict" />
|
|
|
+ <result column="vehicle" jdbcType="INTEGER" property="vehicle" />
|
|
|
+ <result column="vehicle_other" jdbcType="VARCHAR" property="vehicleOther" />
|
|
|
+ <result column="pay_type" jdbcType="INTEGER" property="payType" />
|
|
|
+ <result column="invoice_type" jdbcType="INTEGER" property="invoiceType" />
|
|
|
+ <result column="invoice_no" jdbcType="VARCHAR" property="invoiceNo" />
|
|
|
+ <result column="payer_name" jdbcType="VARCHAR" property="payerName" />
|
|
|
+ <result column="open_bank" jdbcType="VARCHAR" property="openBank" />
|
|
|
+ <result column="bank_accounts" jdbcType="VARCHAR" property="bankAccounts" />
|
|
|
+ <result column="open_bank_address" jdbcType="VARCHAR" property="openBankAddress" />
|
|
|
+
|
|
|
</resultMap>
|
|
|
|
|
|
<update id="updateByIds" >
|
|
|
update expense_account
|
|
|
set status= #{status}
|
|
|
where id in
|
|
|
- <foreach collection="list" open="(" close=")" separator="," item="id">
|
|
|
- #{id}
|
|
|
+ <foreach collection="list" open="(" close=")" separator="," item="item">
|
|
|
+ #{item.id}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
<update id="updateByMainId">
|
|
|
@@ -795,13 +828,13 @@
|
|
|
select b.id,b.check_no,b.total_amount,b.order_no,o.contract_no,b.aname,b.apply_dep,b.pay_dep,
|
|
|
date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,b.status,b.process_status,
|
|
|
dep.name applyDepName,dep2.name payDepName, b.remarks,b.eaaid ,
|
|
|
- c.id sonId,c.total_amount sonAmount,c.`type` ,c.type_other ,c.user_names ,c.release_start ,c.release_end
|
|
|
+ c.id sonId,c.total_amount sonAmount,c.`type` ,c.type_other ,c.user_names ,c.release_start ,c.release_end,
|
|
|
+ c.attachment_url attachmentUrl
|
|
|
from expense_relationship a
|
|
|
left join expense_account b on a.id =b.id
|
|
|
left join department dep on b.apply_dep =dep.id left join department dep2 on b.pay_dep =dep2.id
|
|
|
left join t_order_new o on b.order_no =o.order_no
|
|
|
left join expense_account c on a.ea_id =c.id
|
|
|
-
|
|
|
left join admin ad on b.aid=ad.id
|
|
|
left join department adDep on ad .department_id=adDep.id
|
|
|
where 1=1 and b.expense_main =1
|
|
|
@@ -948,5 +981,13 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <select id="selectCountByIdsAndType" resultType="java.lang.Integer">
|
|
|
+ select count(*) from expense_account
|
|
|
+ where type =#{type}
|
|
|
+ and id in
|
|
|
+ <foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|