|
|
@@ -402,4 +402,13 @@
|
|
|
select ve_id from VENDOR where ve_code=#{code} and companyId=#{companyId}
|
|
|
</select>
|
|
|
|
|
|
+ <update id="updateVendleftamountByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
+ update vendor
|
|
|
+ <set>
|
|
|
+ ve_leftamount=ifnull((select sum(va_leftamount*(case when ifnull(cr_rate,0)=0 then 1 else ifnull(cr_rate,0) end ))
|
|
|
+ from VendApamount left join currencys on cr_name=va_currency and VendApamount.companyid=currencys.companyid
|
|
|
+ where VendApamount.companyid=vendor.companyid and va_vendid=#{ve_id,jdbcType=INTEGER}),0)
|
|
|
+ </set>
|
|
|
+ where ve_id = #{ve_id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
</mapper>
|