|
|
@@ -919,6 +919,9 @@
|
|
|
<if test="whName != null">
|
|
|
AND tmgs.wh_name LIKE concat('%',my_ex.likequery(#{whName}),'%')
|
|
|
</if>
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询库存个数 -->
|
|
|
@@ -937,13 +940,13 @@
|
|
|
AND tpi.non_std_code = #{nonStdCode}
|
|
|
</if>
|
|
|
<if test="skuCode != null">
|
|
|
- AND tmgs.sku_code = #{skuCode}
|
|
|
+ AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
|
|
|
</if>
|
|
|
<if test="skuName != null">
|
|
|
- AND tmgs.sku_name = #{skuName}
|
|
|
+ AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
|
|
|
</if>
|
|
|
<if test="whName != null">
|
|
|
- AND tmgs.wh_name = #{whName}
|
|
|
+ AND tmgs.wh_name LIKE concat('%',my_ex.likequery(#{whName}),'%')
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
@@ -962,20 +965,300 @@
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
- <!--获取员工-->
|
|
|
- <select id="getStaff" resultType="java.util.Map">
|
|
|
- SELECT
|
|
|
- staff_id AS "staffId",
|
|
|
- staff_id AS "id",
|
|
|
- staff_code AS "staffCode",
|
|
|
- staff_name AS "staffName"
|
|
|
- FROM dkic_b.t_mst_staff
|
|
|
+ <!--获取仓库档案-->
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!--获取供应商和客户数据-->
|
|
|
+ <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"
|
|
|
+ null as "phone",
|
|
|
+ null as "addressFull"
|
|
|
+ from dkic_b.t_mst_supplier tms
|
|
|
<where>
|
|
|
- <if test="cpId != null">
|
|
|
- AND cp_id = #{cpId}
|
|
|
+ <if test="flgValid">
|
|
|
+ AND tms.flgValid
|
|
|
+ </if>
|
|
|
+ <if test="objCode != null and objCode != ''">
|
|
|
+ AND tms.sup_code LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
+ AND tms.sup_name LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </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('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
+ AND cus.cus_name LIKE concat('%',my_ex.likequery(#{objName}),'%')
|
|
|
</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",
|
|
|
+ null as "phone",
|
|
|
+ null as "addressFull"
|
|
|
+ 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('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
+ AND tms.sup_name LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </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('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
+ AND cus.cus_name LIKE concat('%',my_ex.likequery(#{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",
|
|
|
+ null as "phone",
|
|
|
+ null as "addressFull"
|
|
|
+ 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('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
+ AND tms.sup_name LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </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('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
+ AND cus.cus_name LIKE concat('%',my_ex.likequery(#{objName}),'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ) tt
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 获取用户 -->
|
|
|
+ <select id="getStaff" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ s.staff_name as "staffName"
|
|
|
+ , s.staff_code as "staffCode"
|
|
|
+ , sys.f_code_name(s.staff_code, s.staff_name) AS "staffCodeName",
|
|
|
+ , s.staff_id as "staffId"
|
|
|
+ , s.staff_id AS "id",
|
|
|
+ , s.org_id as "orgId"
|
|
|
+ , o.org_name as "orgName"
|
|
|
+ , c.cp_name as "cpName"
|
|
|
+ FROM dkic_b.t_mst_staff s
|
|
|
+ left join dkic_b.t_mst_org o on o.org_id = s.org_id
|
|
|
+ left join dkic_a.t_a_company c on c.cp_id = s.cp_id
|
|
|
+ where
|
|
|
+ u.cp_id = #{cpId}
|
|
|
+ <if test="staffCode !=null and staffCode !=''">
|
|
|
+ AND s.staff_code LIKE concat('%',my_ex.likequery(#{staffCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="staffName !=null and staffName !=''">
|
|
|
+ AND s.staff_name LIKE concat('%',my_ex.likequery(#{staffName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgId !=null">
|
|
|
+ AND s.org_id = #{orgId}
|
|
|
+ </if>
|
|
|
+ <if test="orgName !=null and orgName !=''">
|
|
|
+ AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 获取组织机构 -->
|
|
|
+ <select id="getOrganization" resultType="java.util.Map">
|
|
|
+ select o.org_id as "orgId"
|
|
|
+ , o.org_code as "orgCode"
|
|
|
+ , o.org_name as "orgName"
|
|
|
+ , sys.f_code_name(o.org_code, o.org_name) AS "orgCodeName"
|
|
|
+ from dkic_b.t_mst_org o
|
|
|
+ where
|
|
|
+ o.flg_valid
|
|
|
+ and o.cp_id = #{cpId}
|
|
|
+ <if test="orgCode !=null and orgCode !=''">
|
|
|
+ AND o.org_code LIKE concat('%',my_ex.likequery(#{orgCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgName !=null and orgName !=''">
|
|
|
+ AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+ order by o.level_code
|
|
|
+ </select>
|
|
|
+ <!-- 获取组织机构分页 -->
|
|
|
+ <select id="getOrganizationByPage" resultType="java.util.Map">
|
|
|
+ select o.org_id as "orgId"
|
|
|
+ , o.org_code as "orgCode"
|
|
|
+ , o.org_name as "orgName"
|
|
|
+ , sys.f_code_name(o.org_code, o.org_name) AS "orgCodeName"
|
|
|
+ from dkic_b.t_mst_org o
|
|
|
+ where
|
|
|
+ o.flg_valid
|
|
|
+ and o.cp_id = #{cpId}
|
|
|
+ <if test="orgCode !=null and orgCode !=''">
|
|
|
+ AND o.org_code LIKE concat('%',my_ex.likequery(#{orgCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgName !=null and orgName !=''">
|
|
|
+ AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+ order by o.level_code
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <!-- 获取组织机构分个数-->
|
|
|
+ <select id="getOrganizationCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
+ from dkic_b.t_mst_org o
|
|
|
+ where
|
|
|
+ o.flg_valid
|
|
|
+ and o.cp_id = #{cpId}
|
|
|
+ <if test="orgCode !=null and orgCode !=''">
|
|
|
+ AND o.org_code LIKE concat('%',my_ex.likequery(#{orgCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgName !=null and orgName !=''">
|
|
|
+ AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
+ <!-- 获取资金账户(下拉)-->
|
|
|
+ <select id="getMac" resultType="java.util.Map">
|
|
|
+ select tmma.mac_id as "macId",
|
|
|
+ tmma.mac_code as "macCode",
|
|
|
+ tmma.mac_name as "macName",
|
|
|
+ tmma.mac_type as "macType",
|
|
|
+ tmma.balance,
|
|
|
+ tmma.display_no as "displayNo",
|
|
|
+ tmma.flg_default as "flgDefault",
|
|
|
+ tmma.mac_receipt_code as "macReceiptCode",
|
|
|
+ tmma.remarks
|
|
|
+ from dkic_b.t_mst_money_account tmma
|
|
|
+ where tmma.flg_valid
|
|
|
+ and tmma.cp_id = #{cpId}
|
|
|
+ <if test="macCode !=null and macCode !=''">
|
|
|
+ AND tmma.mac_code LIKE concat('%',my_ex.likequery(#{macCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="macName !=null and macName !=''">
|
|
|
+ AND tmma.mac_name LIKE concat('%',my_ex.likequery(#{macName}),'%')
|
|
|
+ </if>
|
|
|
+ order by tmma.display_no
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 获取资金账户(放大镜) -->
|
|
|
+ <select id="getMoneyAccount" resultType="java.util.Map">
|
|
|
+ select tmma.mac_id as "macId",
|
|
|
+ tmma.mac_code as "macCode",
|
|
|
+ tmma.mac_name as "macName",
|
|
|
+ tmma.mac_type as "macType",
|
|
|
+ tmma.balance,
|
|
|
+ tmma.display_no as "displayNo",
|
|
|
+ tmma.flg_default as "flgDefault",
|
|
|
+ tmma.mac_receipt_code as "macReceiptCode",
|
|
|
+ tmma.remarks
|
|
|
+ from dkic_b.t_mst_money_account tmma
|
|
|
+ where tmma.flg_valid
|
|
|
+ and tmma.cp_id = #{cpId}
|
|
|
+ <if test="macCode !=null and macCode !=''">
|
|
|
+ AND tmma.mac_code LIKE concat('%',my_ex.likequery(#{macCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="macName !=null and macName !=''">
|
|
|
+ AND tmma.mac_name LIKE concat('%',my_ex.likequery(#{macName}),'%')
|
|
|
+ </if>
|
|
|
+ order by tmma.display_no
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 获取资金账户(放大镜)个数 -->
|
|
|
+ <select id="getMoneyAccountCountByPage" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ from dkic_b.t_mst_money_account tmma
|
|
|
+ where tmma.flg_valid
|
|
|
+ and tmma.cp_id = #{cpId}
|
|
|
+ <if test="macCode !=null and macCode !=''">
|
|
|
+ AND tmma.mac_code LIKE concat('%',my_ex.likequery(#{macCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="macName !=null and macName !=''">
|
|
|
+ AND tmma.mac_name LIKE concat('%',my_ex.likequery(#{macName}),'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|