|
|
@@ -2,104 +2,51 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.usoftchina.saas.document.mapper.CustomerListMapper">
|
|
|
<resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.CustomerList">
|
|
|
- <id column="pi_id" jdbcType="INTEGER" property="id" />
|
|
|
- <result column="pi_inoutno" jdbcType="VARCHAR" property="pi_inoutno" />
|
|
|
- <result column="pi_class" jdbcType="VARCHAR" property="pi_class" />
|
|
|
- <result column="pi_date" jdbcType="TIMESTAMP" property="pi_date" />
|
|
|
- <result column="pi_vendid" jdbcType="INTEGER" property="pi_vendid" />
|
|
|
- <result column="pi_vendcode" jdbcType="VARCHAR" property="pi_vendcode" />
|
|
|
- <result column="pi_vendname" jdbcType="VARCHAR" property="pi_vendname" />
|
|
|
- <result column="pi_custid" jdbcType="INTEGER" property="pi_custid" />
|
|
|
- <result column="pi_custcode" jdbcType="VARCHAR" property="pi_custcode" />
|
|
|
- <result column="pi_custname" jdbcType="VARCHAR" property="pi_custname" />
|
|
|
- <result column="pi_puid" jdbcType="INTEGER" property="pi_puid" />
|
|
|
- <result column="pi_pucode" jdbcType="VARCHAR" property="pi_pucode" />
|
|
|
- <result column="pi_said" jdbcType="INTEGER" property="pi_said" />
|
|
|
- <result column="pi_sacode" jdbcType="VARCHAR" property="pi_sacode" />
|
|
|
- <result column="pi_total" jdbcType="DOUBLE" property="pi_total" />
|
|
|
- <result column="pi_recordmanid" jdbcType="INTEGER" property="pi_recordmanid" />
|
|
|
- <result column="pi_recordman" jdbcType="VARCHAR" property="pi_recordman" />
|
|
|
- <result column="pi_recorddate" jdbcType="TIMESTAMP" property="pi_recorddate" />
|
|
|
- <result column="pi_status" jdbcType="VARCHAR" property="pi_status" />
|
|
|
- <result column="pi_statuscode" jdbcType="VARCHAR" property="pi_statuscode" />
|
|
|
- <result column="pi_printstatus" jdbcType="VARCHAR" property="pi_printstatus" />
|
|
|
- <result column="pi_printstatuscode" jdbcType="VARCHAR" property="pi_printstatuscode" />
|
|
|
- <result column="pi_text1" jdbcType="VARCHAR" property="pi_text1" />
|
|
|
- <result column="pi_text2" jdbcType="VARCHAR" property="pi_text2" />
|
|
|
- <result column="pi_text3" jdbcType="VARCHAR" property="pi_text3" />
|
|
|
- <result column="pi_text4" jdbcType="VARCHAR" property="pi_text4" />
|
|
|
- <result column="pi_text5" jdbcType="VARCHAR" property="pi_text5" />
|
|
|
- <result column="pi_address" jdbcType="VARCHAR" property="pi_address" />
|
|
|
- <result column="pd_piid" jdbcType="INTEGER" property="pd_piid" />
|
|
|
- <result column="pd_inoutno" jdbcType="VARCHAR" property="pd_inoutno" />
|
|
|
- <result column="pd_piclass" jdbcType="VARCHAR" property="pd_piclass" />
|
|
|
- <result column="pd_pdno" jdbcType="INTEGER" property="pd_pdno" />
|
|
|
- <result column="pd_ordercode" jdbcType="VARCHAR" property="pd_ordercode" />
|
|
|
- <result column="pd_orderdetno" jdbcType="INTEGER" property="pd_orderdetno" />
|
|
|
- <result column="pd_prodid" jdbcType="INTEGER" property="pd_prodid" />
|
|
|
- <result column="pd_prodcode" jdbcType="VARCHAR" property="pd_prodcode" />
|
|
|
- <result column="pd_unit" jdbcType="VARCHAR" property="pd_unit" />
|
|
|
- <result column="pd_inqty" jdbcType="INTEGER" property="pd_inqty" />
|
|
|
- <result column="pd_outqty" jdbcType="INTEGER" property="pd_outqty" />
|
|
|
- <result column="pd_orderprice" jdbcType="DOUBLE" property="pd_orderprice" />
|
|
|
- <result column="pd_sendprice" jdbcType="DOUBLE" property="pd_sendprice" />
|
|
|
- <result column="pd_price" jdbcType="DOUBLE" property="pd_price" />
|
|
|
- <result column="pd_total" jdbcType="DOUBLE" property="pd_total" />
|
|
|
- <result column="pd_taxrate" jdbcType="DOUBLE" property="pd_taxrate" />
|
|
|
- <result column="pd_netprice" jdbcType="DOUBLE" property="pd_netprice" />
|
|
|
- <result column="pd_nettotal" jdbcType="DOUBLE" property="pd_nettotal" />
|
|
|
- <result column="pd_whid" jdbcType="INTEGER" property="pd_whid" />
|
|
|
- <result column="pd_whcode" jdbcType="VARCHAR" property="pd_whcode" />
|
|
|
- <result column="pd_whname" jdbcType="VARCHAR" property="pd_whname" />
|
|
|
- <result column="pd_inwhid" jdbcType="INTEGER" property="pd_inwhid" />
|
|
|
- <result column="pd_inwhcode" jdbcType="VARCHAR" property="pd_inwhcode" />
|
|
|
- <result column="pd_inwhname" jdbcType="VARCHAR" property="pd_inwhname" />
|
|
|
- <result column="pd_orderid" jdbcType="INTEGER" property="pd_orderid" />
|
|
|
- <result column="pd_sdid" jdbcType="INTEGER" property="pd_sdid" />
|
|
|
- <result column="pd_status" jdbcType="INTEGER" property="pd_status" />
|
|
|
- <result column="companyid" jdbcType="INTEGER" property="companyId" />
|
|
|
- <result column="updaterid" jdbcType="INTEGER" property="updaterId" />
|
|
|
- <result column="updatetime" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
- <result column="pd_text1" jdbcType="VARCHAR" property="pd_text1" />
|
|
|
- <result column="pd_text2" jdbcType="VARCHAR" property="pd_text2" />
|
|
|
- <result column="pd_text3" jdbcType="VARCHAR" property="pd_text3" />
|
|
|
- <result column="pd_text4" jdbcType="VARCHAR" property="pd_text4" />
|
|
|
- <result column="pd_text5" jdbcType="VARCHAR" property="pd_text5" />
|
|
|
- <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
|
|
|
- <result column="pd_yqty" jdbcType="INTEGER" property="pd_yqty" />
|
|
|
- <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
|
|
|
+ <id column="cc_id" jdbcType="INTEGER" property="id" />
|
|
|
+ <result column="cc_cuid" jdbcType="INTEGER" property="cc_cuid" />
|
|
|
+ <result column="cc_detno" jdbcType="INTEGER" property="cc_detno" />
|
|
|
+ <result column="cc_name" jdbcType="VARCHAR" property="cc_name" />
|
|
|
+ <result column="cc_tel" jdbcType="INTEGER" property="cc_tel" />
|
|
|
+ <result column="cc_qq" jdbcType="VARCHAR" property="cc_qq" />
|
|
|
+ <result column="cc_email" jdbcType="VARCHAR" property="cc_email" />
|
|
|
+ <result column="ca_cuid" jdbcType="INTEGER" property="ca_cuid" />
|
|
|
+ <result column="ca_detno" jdbcType="INTEGER" property="ca_detno" />
|
|
|
+ <result column="ca_person" jdbcType="VARCHAR" property="ca_person" />
|
|
|
+ <result column="ca_phone" jdbcType="INTEGER" property="ca_phone" />
|
|
|
+ <result column="ca_default" jdbcType="INTEGER" property="ca_default" />
|
|
|
+ <result column="cc_cuid" jdbcType="INTEGER" property="cc_cuid" />
|
|
|
+ <result column="cc_detno" jdbcType="INTEGER" property="cc_detno" />
|
|
|
+ <result column="cc_name" jdbcType="VARCHAR" property="cc_name" />
|
|
|
+ <result column="cc_tel" jdbcType="INTEGER" property="cc_tel" />
|
|
|
+ <result column="cc_qq" jdbcType="VARCHAR" property="cc_qq" />
|
|
|
+ <result column="cc_email" jdbcType="VARCHAR" property="cc_email" />
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
- <select id="selectCustomerListByCondition" parameterType="string" resultMap="BaseResultMap">
|
|
|
- select * from purchase left join purchasedetail on pu_id=pd_puid
|
|
|
+ <select id="selectCustomerListByCondition" resultMap="BaseResultMap">
|
|
|
+ select * from customer left join customeraddress on cu_id=ca_cuid left join customercontact on cu_id = cc_cuid
|
|
|
<where>
|
|
|
<if test="con != null">
|
|
|
${con}
|
|
|
</if>
|
|
|
<if test="companyId != null">
|
|
|
- and companyId = #{companyId}
|
|
|
+ and companyid = #{companyId}
|
|
|
</if>
|
|
|
- </where> order by pu_id,pd_detno
|
|
|
+ </where> order by cu_id
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectCustomerBycondition" parameterType="string" resultMap="BaseResultMap">
|
|
|
- select * from prodinout
|
|
|
+ <select id="selectCustomerBycondition" resultMap="BaseResultMap">
|
|
|
+ select * from customer
|
|
|
<where>
|
|
|
- <if test="begin != null">
|
|
|
- pu_date >= ${begin}
|
|
|
- </if>
|
|
|
- <if test="end!= null">
|
|
|
- AND pu_date <= ${end}
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- AND pu_status=${status}
|
|
|
+ <if test="con != null">
|
|
|
+ ${con}
|
|
|
</if>
|
|
|
- <if test="keyword != null">
|
|
|
- AND ${keyword}
|
|
|
+ <if test="companyId != null">
|
|
|
+ and companyid = #{companyId}
|
|
|
</if>
|
|
|
</where>
|
|
|
+ order by cu_id
|
|
|
</select>
|
|
|
|
|
|
|