|
@@ -978,4 +978,152 @@
|
|
|
</select>
|
|
</select>
|
|
|
<!--获取仓库档案-->
|
|
<!--获取仓库档案-->
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <!--获取供应商和客户数据-->
|
|
|
|
|
+ <select id="getSupplierAndCustomer" resultType="java.util.Map">
|
|
|
|
|
+ select tms.sup_id as "objId",
|
|
|
|
|
+ tms.sup_code as "objCode",
|
|
|
|
|
+ tms.sup_name as "objName",
|
|
|
|
|
+ '供应商' as "objTypeName",
|
|
|
|
|
+ 1 as "objType",
|
|
|
|
|
+ tms.flg_valid as "flgValid"
|
|
|
|
|
+ from dkic_b.t_mst_supplier tms
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="flgValid">
|
|
|
|
|
+ AND tms.flgValid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objCode != null and objCode != ''">
|
|
|
|
|
+ AND tms.sup_code LIKE concat('%', #{objCode}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
|
|
+ AND tms.sup_name LIKE concat('%', #{objName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ union all
|
|
|
|
|
+ select cus.cus_id as "objId",
|
|
|
|
|
+ cus.cus_code as "objCode",
|
|
|
|
|
+ cus.cus_name as "objName",
|
|
|
|
|
+ '客户' as "objTypeName",
|
|
|
|
|
+ 2 as "objType",
|
|
|
|
|
+ cus.flg_valid as "flgValid",
|
|
|
|
|
+ cus.cus_phone as "phone",
|
|
|
|
|
+ cus.address_full as "addressFull"
|
|
|
|
|
+ from dkic_b.t_mst_customer cus
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="flgValid">
|
|
|
|
|
+ AND cus.flgValid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objCode != null and objCode != ''">
|
|
|
|
|
+ AND cus.cus_code LIKE concat('%', #{objCode}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
|
|
+ AND cus.cus_name LIKE concat('%', #{objName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="flgValid">
|
|
|
|
|
+ AND cus.flgValid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <!--获取供应商和客户数据分页-->
|
|
|
|
|
+ <select id="getSupplierAndCustomerByPage" resultType="java.util.Map">
|
|
|
|
|
+ select * from(
|
|
|
|
|
+ select tms.sup_id as "objId",
|
|
|
|
|
+ tms.sup_code as "objCode",
|
|
|
|
|
+ tms.sup_name as "objName",
|
|
|
|
|
+ '供应商' as "objTypeName",
|
|
|
|
|
+ 1 as "objType",
|
|
|
|
|
+ tms.flg_valid as "flgValid",
|
|
|
|
|
+ tms.contact_phone as "phone"
|
|
|
|
|
+ null as "customerPhone" ,
|
|
|
|
|
+ tms.contact_name as "contactName" ,
|
|
|
|
|
+ tms.contact_phone as "contactPhones"
|
|
|
|
|
+ from dkic_b.t_mst_supplier tms
|
|
|
|
|
+ <where >
|
|
|
|
|
+ <if test="flgValid">
|
|
|
|
|
+ AND tms.flgValid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objCode != null and objCode != ''">
|
|
|
|
|
+ AND tms.sup_code LIKE concat('%', #{objCode}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
|
|
+ AND tms.sup_name LIKE concat('%', #{objName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ union all
|
|
|
|
|
+ select cus.cus_id as "objId",
|
|
|
|
|
+ cus.cus_code as "objCode",
|
|
|
|
|
+ cus.cus_name as "objName",
|
|
|
|
|
+ '客户' as "objTypeName",
|
|
|
|
|
+ 2 as "objType",
|
|
|
|
|
+ cus.flg_valid as "flgValid",
|
|
|
|
|
+ cus.cus_phone as "phone",
|
|
|
|
|
+ cus.address_full as "addressFull"
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="flgValid">
|
|
|
|
|
+ AND cus.flgValid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objCode != null and objCode != ''">
|
|
|
|
|
+ AND cus.cus_code LIKE concat('%', #{objCode}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
|
|
+ AND cus.cus_name LIKE concat('%', #{objName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="flgValid">
|
|
|
|
|
+ AND cus.flgValid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ) tt
|
|
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
|
|
+ limit #{end} offset #{start}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <!--获取供应商和客户数据分页-->
|
|
|
|
|
+ <select id="getSupplierAndCustomerByPageCount" resultType="Long">
|
|
|
|
|
+ select count(1) from(
|
|
|
|
|
+ select tms.sup_id as "objId",
|
|
|
|
|
+ tms.sup_code as "objCode",
|
|
|
|
|
+ tms.sup_name as "objName",
|
|
|
|
|
+ '供应商' as "objTypeName",
|
|
|
|
|
+ 1 as "objType",
|
|
|
|
|
+ tms.flg_valid as "flgValid"
|
|
|
|
|
+ from dkic_b.t_mst_supplier tms
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="flgValid">
|
|
|
|
|
+ AND tms.flgValid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objCode != null and objCode != ''">
|
|
|
|
|
+ AND tms.sup_code LIKE concat('%', #{objCode}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
|
|
+ AND tms.sup_name LIKE concat('%', #{objName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ union all
|
|
|
|
|
+ select cus.cus_id as "objId",
|
|
|
|
|
+ cus.cus_code as "objCode",
|
|
|
|
|
+ cus.cus_name as "objName",
|
|
|
|
|
+ '客户' as "objTypeName",
|
|
|
|
|
+ 2 as "objType",
|
|
|
|
|
+ cus.flg_valid as "flgValid",
|
|
|
|
|
+ cus.cus_phone as "phone",
|
|
|
|
|
+ cus.address_full as "addressFull"
|
|
|
|
|
+ from dkic_b.t_csm_customer cus
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="flgValid">
|
|
|
|
|
+ AND cus.flgValid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objCode != null and objCode != ''">
|
|
|
|
|
+ AND cus.cus_code LIKE concat('%', #{objCode}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
|
|
+ AND cus.cus_name LIKE concat('%', #{objName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="flgValid">
|
|
|
|
|
+ AND cus.flgValid
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ) tt
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
</mapper>
|
|
</mapper>
|