| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?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.usoftchina.saas.money.mapper.CustomerCheckViewMapper" >
- <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.CustomerCheckView" >
- <result column="pi_inoutno" property="pi_inoutno" jdbcType="VARCHAR" />
- <result column="pi_class" property="pi_class" jdbcType="VARCHAR" />
- <result column="pi_custcode" property="pi_custcode" jdbcType="VARCHAR" />
- <result column="pi_custname" property="pi_custname" jdbcType="VARCHAR" />
- <result column="pi_date" property="pi_date" jdbcType="TIMESTAMP" />
- <result column="pd_pdno" property="pd_pdno" jdbcType="INTEGER" />
- <result column="pr_code" property="pr_code" jdbcType="VARCHAR" />
- <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
- <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR" />
- <result column="pd_unit" property="pd_unit" jdbcType="VARCHAR" />
- <result column="qty" property="qty" jdbcType="DOUBLE" />
- <result column="pd_orderprice" property="pd_orderprice" jdbcType="DOUBLE" />
- <result column="pd_taxrate" property="pd_taxrate" jdbcType="DOUBLE" />
- <result column="pd_total" property="pd_total" jdbcType="DOUBLE" />
- <result column="pd_netprice" property="pd_netprice" jdbcType="DOUBLE" />
- <result column="pd_nettotal" property="pd_nettotal" jdbcType="DOUBLE" />
- </resultMap>
- <select id="selectByCondition" resultMap="BaseResultMap">
- select * from customer_amount_view
- <where>
- <if test="con != null">
- ${con}
- </if>
- <if test="companyId != null">
- and companyId = #{companyId}
- </if>
- </where>
- order by pi_custname asc, pi_date desc, pi_custcode desc
- </select>
- <select id="selectCalculateFields" resultType="string">
- select ${fields} from customer_amount_view
- <where>
- <if test="con != null">
- ${con}
- </if>
- <if test="companyId != null">
- and companyId = #{companyId}
- </if>
- </where>
- </select>
- <resultMap id="BaseAddMap" type="com.usoftchina.saas.money.po.VendOrCustAdd" >
- <result column="beginamount" property="beginamount" jdbcType="DOUBLE" />
- <result column="nowamount" property="nowamount" jdbcType="DOUBLE" />
- <result column="nowpay" property="beginamount" jdbcType="DOUBLE" />
- </resultMap>
- <select id="selectCustAdd" resultMap="BaseAddMap">
- select a.sl_orderamount as beginamount, b.nowamount, b.nowpay,(a.sl_orderamount +b.nowamount-b.nowpay) as nowbalance FROM
- (select sl_orderamount,sl_custid,sl_date, companyid from subledger where sl_kind = '期初余额') a
- left join (select sum(sl_amount) as nowamount,sum(sl_preamount) as nowpay,sl_custid,sl_date from subledger where sl_kind !='期初余额'
- group by sl_custid,sl_date) b
- on a.sl_custid=b.sl_custid
- where a.sl_custid=#{sl_custid} and a.sl_date ${cons} and a.companyid = #{companyId} limit 1
- </select>
- <select id="getId" resultType="java.lang.Integer">
- select cu_id from customer where cu_code = #{code} and companyId = #{companyId}
- </select>
- </mapper>
|