|
|
|
@ -43,6 +43,77 @@ |
|
|
|
|
<sql id="Buyer_Base_Column_List"> |
|
|
|
|
id,taxpayer_code,purchase_name,address,phone,bank_of_deposit,bank_number,email,sjh,remarks,create_time,create_user_id,modify_time,modify_user_id,ghf_qylx,xhf_nsrsbh,xhf_mc,buyer_code,invoice_name,invoice_taxno,mdm_multicode_json,status |
|
|
|
|
</sql> |
|
|
|
|
<sql id="Buyer_Where"> |
|
|
|
|
<where> |
|
|
|
|
<if test="shList != null and shList.size() == 0"> |
|
|
|
|
and xhf_nsrsbh = '' |
|
|
|
|
</if> |
|
|
|
|
<if test="shList != null and shList.size() == 1"> |
|
|
|
|
and xhf_nsrsbh = |
|
|
|
|
<foreach collection="shList" index="index" item="item"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="shList != null and shList.size() > 1"> |
|
|
|
|
and xhf_nsrsbh in |
|
|
|
|
<foreach collection="shList" index="index" item="item" |
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="map.entList != null and map.entList.size() == 0"> |
|
|
|
|
and ent_id = '' |
|
|
|
|
</if> |
|
|
|
|
<if test="map.entList != null and map.entList.size() == 1"> |
|
|
|
|
and ent_id = |
|
|
|
|
<foreach collection="map.entList" index="index" item="item"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="map.entList != null and map.entList.size() > 1"> |
|
|
|
|
and ent_id in |
|
|
|
|
<foreach collection="map.entList" index="index" item="item" |
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<!--购买方编码--> |
|
|
|
|
<if test="map.buyerCode != null and map.buyerCode !='' "> |
|
|
|
|
and buyer_code LIKE CONCAT(CONCAT('%',#{map.buyerCode,jdbcType=VARCHAR},'%')) |
|
|
|
|
</if> |
|
|
|
|
<!-- 销货方纳税人名称--> |
|
|
|
|
<if test="map.xhfMc != null and map.xhfMc !='' "> |
|
|
|
|
and xhf_mc = #{map.xhfMc,jdbcType=VARCHAR} |
|
|
|
|
</if> |
|
|
|
|
<!-- 客户状态--> |
|
|
|
|
<if test="map.status != null and map.status !='' "> |
|
|
|
|
and status = #{map.status,jdbcType=VARCHAR} |
|
|
|
|
</if> |
|
|
|
|
<!--购买方纳税人识别号--> |
|
|
|
|
<if test="map.taxpayerCode !=null and map.taxpayerCode !=''"> |
|
|
|
|
and taxpayer_code = #{map.taxpayerCode,jdbcType=VARCHAR} |
|
|
|
|
</if> |
|
|
|
|
<if test="map.purchaseName != null and map.purchaseName !='' "> |
|
|
|
|
<choose> |
|
|
|
|
<!--模糊查询的标识(0表示不进行模糊查询,1表示模糊查询)--> |
|
|
|
|
<when test="map.fuzzyQuery != null and map.fuzzyQuery !='' and map.fuzzyQuery =='0'.toString() "> |
|
|
|
|
AND purchase_name = #{map.purchaseName,jdbcType=VARCHAR} |
|
|
|
|
</when> |
|
|
|
|
<otherwise> |
|
|
|
|
AND purchase_name LIKE CONCAT(CONCAT('%',#{map.purchaseName}),'%') |
|
|
|
|
</otherwise> |
|
|
|
|
</choose> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
</sql> |
|
|
|
|
<select id="selectBuyerCount" resultType="java.lang.Integer"> |
|
|
|
|
SELECT |
|
|
|
|
count(1) |
|
|
|
|
FROM |
|
|
|
|
buyer_manage_info |
|
|
|
|
<include refid="Buyer_Where"/> |
|
|
|
|
</select> |
|
|
|
|
<!-- 查询 --> |
|
|
|
|
<select parameterType="map" id="selectBuyerList" resultMap="BaseResultMap"> |
|
|
|
|
<bind name="dataType" value="${dataType}"/> |
|
|
|
@ -82,69 +153,7 @@ |
|
|
|
|
|
|
|
|
|
FROM |
|
|
|
|
buyer_manage_info bmi left join buyer_manage_info_detail bmid on bmi.id = bmid.buyer_manage_id |
|
|
|
|
<where> |
|
|
|
|
<if test="shList != null and shList.size() == 0"> |
|
|
|
|
and xhf_nsrsbh = '' |
|
|
|
|
</if> |
|
|
|
|
<if test="shList != null and shList.size() == 1"> |
|
|
|
|
and xhf_nsrsbh = |
|
|
|
|
<foreach collection="shList" index="index" item="item"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="shList != null and shList.size() > 1"> |
|
|
|
|
and xhf_nsrsbh in |
|
|
|
|
<foreach collection="shList" index="index" item="item" |
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
<if test="map.entList != null and map.entList.size() == 0"> |
|
|
|
|
and ent_id = '' |
|
|
|
|
</if> |
|
|
|
|
<if test="map.entList != null and map.entList.size() == 1"> |
|
|
|
|
and ent_id = |
|
|
|
|
<foreach collection="map.entList" index="index" item="item"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="map.entList != null and map.entList.size() > 1"> |
|
|
|
|
and ent_id in |
|
|
|
|
<foreach collection="map.entList" index="index" item="item" |
|
|
|
|
open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<!--购买方编码--> |
|
|
|
|
<if test="map.buyerCode != null and map.buyerCode !='' "> |
|
|
|
|
and buyer_code LIKE CONCAT(CONCAT('%',#{map.buyerCode,jdbcType=VARCHAR},'%')) |
|
|
|
|
</if> |
|
|
|
|
<!-- 销货方纳税人名称--> |
|
|
|
|
<if test="map.xhfMc != null and map.xhfMc !='' "> |
|
|
|
|
and xhf_mc = #{map.xhfMc,jdbcType=VARCHAR} |
|
|
|
|
</if> |
|
|
|
|
<!-- 客户状态--> |
|
|
|
|
<if test="map.status != null and map.status !='' "> |
|
|
|
|
and status = #{map.status,jdbcType=VARCHAR} |
|
|
|
|
</if> |
|
|
|
|
<!--购买方纳税人识别号--> |
|
|
|
|
<if test="map.taxpayerCode !=null and map.taxpayerCode !=''"> |
|
|
|
|
and taxpayer_code = #{map.taxpayerCode,jdbcType=VARCHAR} |
|
|
|
|
</if> |
|
|
|
|
<if test="map.purchaseName != null and map.purchaseName !='' "> |
|
|
|
|
<choose> |
|
|
|
|
<!--模糊查询的标识(0表示不进行模糊查询,1表示模糊查询)--> |
|
|
|
|
<when test="map.fuzzyQuery != null and map.fuzzyQuery !='' and map.fuzzyQuery =='0'.toString() "> |
|
|
|
|
AND purchase_name = #{map.purchaseName,jdbcType=VARCHAR} |
|
|
|
|
</when> |
|
|
|
|
<otherwise> |
|
|
|
|
AND purchase_name LIKE CONCAT(CONCAT('%',#{map.purchaseName}),'%') |
|
|
|
|
</otherwise> |
|
|
|
|
</choose> |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
|
|
|
|
|
<include refid="Buyer_Where"/> |
|
|
|
|
order by create_time desc |
|
|
|
|
</if> |
|
|
|
|
<if test="dataType ==1 "> |
|
|
|
|