| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264 |
- <?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.dk.mdm.mapper.common.CommonMapper">
- <!-- 获取显示顺序的最大值 -->
- <select id="getMaxDisplayNo" resultType="Integer">
- select max(display_no) + 1
- from ${table}
- where flg_valid
- <if test="ftyId != null">
- and fty_id = #{ftyId}
- </if>
- <if test="otherCond">
- and ${otherCond}
- </if>
- <!--数据字典-->
- <if test="dictCode != null">
- and dict_code = #{dictCode}
- </if>
- </select>
- <!--获取编码-->
- <select id="getUniqueCode" resultType="java.util.Map">
- select out_id AS "outId", out_code AS "outNote"
- from dkic_b.f_create_code_id(#{cpId}, #{docName});
- </select>
- <!--获取单号-->
- <select id="getUniqueNote" resultType="java.util.Map">
- select out_id AS "outId", out_note AS "outNote"
- from dkic_b.f_create_note_id(#{cpId}, #{docName});
- </select>
- <!-- 获取用户菜单-->
- <select id="getMenuByUser" resultType="java.util.Map">
- select menu_uuid AS "menuUuid",
- name AS "name",
- menu_name AS "menuName",
- parent_uuid AS "parentUuid",
- menu_type AS "menuType",
- flg_menu AS "flgMenu",
- object_code AS "objectCode",
- object_path AS "objectPath",
- object_icon AS "icon",
- object_id AS "objectId",
- menu_tags AS "menuTags",
- level_code AS "levelCode",
- flg_same_route AS "flgSameRoute",
- flg_choose_id AS "flgChooseId",
- flg_auto_query AS "flgAutoQuery",
- page_grid_info AS "pageGridInfo",
- grade_code AS "gradeCode",
- grade_level AS "gradeLevel",
- is_vip AS "isVip",
- #{appCode} AS "appCode",
- menu_uuid AS "id",
- parent_uuid AS "parentId"
- from
- dkic_b.f_get_user_menu(#{appCode}, #{userId } ::uuid,#{cpId},#{lang})
- </select>
- <!--查用户功能权限-->
- <select id="getUserFunction" resultType="java.util.Map">
- select appm.menu_uuid AS "menuUuid"
- , appm.menu_name as name
- , sys.f_get_name_i18n_lang(appm.menu_name_i18n, #{i18n}) as "menuName"
- , rr.fun_uuid AS "funUuid"
- , appm.object_code AS "objectCode"
- , appm.menu_type AS "menuType"
- from sys.t_app_menu appm
- inner join core.t_user_fun rr
- on rr.fun_uuid = appm.fun_uuid
- where appm.flg_valid
- and appm.app_code = #{appCode}
- and appm.menu_type IN (1, 2)
- and rr.user_id = #{userId};
- </select>
- <!--查询用于隐藏列信息-->
- <select id="getUserTableInfo" resultType="java.util.Map">
- select tuts.code,
- tuts.table_type AS "tableType",
- tuts.table_ref AS "tableRef",
- tuts.columns
- from pset.t_user_table_set tuts
- where tuts.flg_valid
- and tuts.user_id = #{userId};
- </select>
- <!--查导航菜单(自定义报表用)-->
- <select id="getMenuNavigation" resultType="java.util.Map">
- select appm.menu_uuid AS "menuUuid"
- ,sys.f_get_name_i18n_lang(appm.menu_name_i18n,#{i18n}) as "menuName"
- ,appm.parent_uuid AS "parentUuid"
- from sys.t_app_menu appm
- where appm.flg_valid
- <if test="parentUuid">
- and appm.parent_uuid = #{parentUuid} ::uuid
- </if>
- and appm.app_code = 'WEB-MAIN'
- and appm.menu_type = 0
- </select>
- <!-- 获取应用-->
- <select id="getApplication" resultType="java.util.Map">
- select
- app_code as "appCode",
- app_name as "appName"
- from sys.t_application
- </select>
- <!--获取单据-->
- <select id="getDoc" resultType="java.util.Map">
- SELECT
- tsd.doc_code AS "docCode",
- sys.f_get_name_i18n_lang ( tsd.doc_name_i18n, #{i18n}) AS "docName"
- FROM
- sys.t_s_doc tsd
- WHERE
- tsd.flg_valid
- <if test="flgApproval!=null">
- and tsd.flg_approval = #{flgApproval}
- </if>
- </select>
- <!-- 获取数据种类 -->
- <select id="getDataKind" resultType="java.util.Map">
- select kind_code AS "kindCode",
- sys.f_get_name_i18n(kind_name_i18n,#{i18n}) as "kindName",
- sys.f_get_name_i18n(kind_desc,#{i18n}) as "gradeKindDesc",
- kind_type AS "kindType",
- kind_tags AS "kindTags",
- display_no AS "displayNo",
- kind_code AS "id",
- remarks
- from sys.t_data_kind
- where flg_valid
- <if test="kindType != null">
- AND kind_type = #{kindType}
- </if>
- <if test="usedFlag != null">
- AND kind_tags -> 'used' ?? '标签'
- </if>
- <if test="kindTag != null">
- AND kind_tags -> 'used' ?? #{kindTag}
- </if>
- <if test="kindCodeList != null and kindCodeList.size()>0">
- AND kind_code =any(#{kindCodeList,typeHandler=StringListTypeHandler})
- </if>
- order by display_no
- </select>
- <!-- 获取组织部门 -->
- <select id="getOrg" resultType="java.util.Map">
- select org_Id AS "orgId",
- org_code AS "orgCode",
- org_name AS "orgName",
- org_Id AS "id",
- parent_id AS "parentId",
- top_Id AS "topId",
- display_no AS "displayNo",
- remarks
- from dkic_b.t_mst_org
- where flg_valid
- and cp_id = #{cpId}
- <if test="topId != null">
- AND top_id = #{topId}
- </if>
- <if test="orgId != null">
- AND org_id != #{orgId}
- </if>
- <if test="orgCode != null">
- AND org_code LIKE concat('%',my_ex.likequery(#{orgCode}),'%')
- </if>
- <if test="orgName != null">
- AND org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
- </if>
- order by display_no
- </select>
- <!-- 只获取二级部门 按照level_code 排序 -->
- <select id="getProcureOrg" resultType="java.util.Map">
- select org_Id AS "orgId",
- org_code AS "orgCode",
- org_name AS "orgName",
- org_Id AS "id",
- parent_id AS "parentId",
- top_Id AS "topId",
- display_no AS "displayNo",
- remarks
- from dkic_b.t_mst_org
- where flg_valid
- and cp_id = #{cpId}
- and parent_id is NOT null
- <if test="topId != null">
- AND top_id = #{topId}
- </if>
- <if test="orgId != null">
- AND org_id != #{orgId}
- </if>
- <if test="orgCode != null">
- AND org_code LIKE concat('%',my_ex.likequery(#{orgCode}),'%')
- </if>
- <if test="orgName != null">
- AND org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
- </if>
- order by level_code
- </select>
- <!-- t_mst_org,(条件查询)个数 -->
- <select id="getOrgCountByPage" resultType="Long">
- SELECT
- count(1)
- from dkic_b.t_mst_org
- where flg_valid
- and cp_id = #{cpId}
- <if test="topId != null">
- AND top_id = #{topId}
- </if>
- <if test="orgId != null">
- AND org_id != #{orgId}
- </if>
- <if test="orgCode != null">
- AND org_code LIKE concat('%',my_ex.likequery(#{orgCode}),'%')
- </if>
- <if test="orgName != null">
- AND org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
- </if>
- </select>
- <!-- 获取角色 -->
- <select id="getRole" resultType="java.util.Map">
- select role_Id AS "roleId",
- role_name AS "roleName",
- display_no AS "displayNo",
- remarks
- from dkic_b.t_mst_role
- where cp_id = #{cpId}
- and flg_valid
- order by display_no
- </select>
- <!-- 获取员工 -->
- <select id="getStaffByPage" resultType="java.util.Map">
- select staff.staff_id AS "staffId",
- staff.staff_code AS "staffCode",
- staff.staff_name AS "staffName",
- sys.f_code_name(staff.staff_code, staff.staff_name) AS "staffCodeName",
- staff.remarks
- ,tmg.org_id as "orgId"
- ,tmg.org_code as "orgCode"
- ,tmg.org_name as "orgName"
- from dkic_b.t_mst_staff AS staff
- left join dkic_b.t_mst_org tmg on tmg.org_id = staff.org_id
- where staff.flg_valid
- and staff.cp_id =#{cpId}
- <if test="staffCode != null and staffCode != ''">
- And position (#{staffCode} in staff.staff_code)>0
- </if>
- <if test="staffName != null and staffName != ''">
- And position (#{staffName} in staff.staff_name)>0
- </if>
- order by staff.staff_code
- <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
- limit #{end} offset #{start}
- </if>
- </select>
- <!-- 查询表t_user,(条件查询)个数 -->
- <select id="getStaffCountByPage" resultType="Long">
- SELECT
- count(1)
- from dkic_b.t_mst_staff AS staff
- where staff.flg_valid
- and staff.cp_id =#{cpId}
- <if test="staffCode != null and staffCode != ''">
- And position (#{staffCode} in staff.staff_code)>0
- </if>
- <if test="staffName != null and staffName != ''">
- And position (#{staffName} in staff.staff_name)>0
- </if>
- </select>
- <!-- 函数查询单个系统参数-->
- <select id="getSettingValue" resultType="String">
- select core.f_get_setting_value(#{code}, #{ftyId})
- </select>
- <!-- 函数查询多个系统参数-->
- <select id="getSettingValues" resultType="Map">
- select core.f_get_setting_values(
- #{codes, typeHandler=StringListTypeHandler}, #{ftyId})
- </select>
- <!-- 查询系统参数分类 -->
- <select id="getSettingKind" resultType="java.util.Map">
- select sk.kind_code as "classCode",
- sys.f_get_name_i18n_lang(sk.kind_name_i18n, #{i18n}) as "className",
- sk.display_no as "displayNo"
- from sys.t_setting_kind as sk
- where sk.flg_valid
- order by sk.display_no
- </select>
- <!-- 获取数据字典 -->
- <select id="getDictionaryData" resultType="java.util.Map">
- select dd.data_id as "dataId",
- dd.data_id as "id",
- dd.dict_code as "dictCode",
- dd.data_code as "dataCode",
- dd.data_value as "dataValue",
- dd.flg_default as "flgDefault"
- from dkic_b.t_mst_dictionary_data as dd
- where dd.flg_valid
- and dd.cp_id = #{cpId}
- and dd.dict_code = #{dictCode}
- order by dd.display_no
- </select>
- <!-- 获取数据字典项目 -->
- <select id="getDictionaryItemData" resultType="java.util.Map">
- SELECT stdi.dict_code AS "dictCode",
- sys.f_get_name_i18n_lang(stdi.dict_name_i18n, 'zh_CN') AS "dictName"
- FROM sys.t_dictionary_item stdi
- WHERE stdi.flg_valid
- AND stdi.level_no NOT IN ('1')
- </select>
- <!-- 获取数据类型 -->
- <select id="getValueKind" resultType="java.util.Map">
- select tvk.kind_code AS "kindCode",
- tvk.kind_name as "kindName",
- sys.f_get_name_i18n_lang(tvk.kind_name_i18n,#{i18n}) AS "kindLabel"
- from sys.t_value_kind as tvk
- where tvk.flg_valid
- <if test="used != null and used != ''">
- and #{used} = ANY (tvk.used)
- </if>
- order by tvk.display_no
- </select>
- <!-- 获取仓库 -->
- <select id="getWarehouse" resultType="java.util.Map">
- SELECT tmw.wh_id as "whId"
- ,tmw.wh_id AS "id"
- ,tmw.wh_name as "whName"
- ,tmw.wh_code as "whCode"
- ,tmw.flg_default as "flgDefault"
- FROM dkic_b.t_mst_warehouse tmw
- WHERE tmw.cp_id = #{cpId}
- and tmw.flg_valid
- <if test="whCode!=null and whCode!=''">
- and position(#{whCode} in tmw.wh_code) > 0
- </if>
- <if test="whName!=null and whName!=''">
- and position(#{whName} in tmw.wh_name) > 0
- </if>
- <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
- limit #{end} offset #{start}
- </if>
- </select>
- <!-- 获取商品 -->
- <select id="getGoods" resultType="java.util.Map">
- select tmgs.sku_id as "skuId",
- tmgs.sku_code as "skuCode",
- tmgs.sku_name as "skuName",
- tmgs.sku_model as "skuModel",
- tmgs.brand_id as "brandId",
- tmgb.brand_name as "brandName",
- tmgs.category_id as "categoryId",
- tmgc.cat_name as "categoryName",
- tmgs.unit_id as "unitId",
- tmgu.unit_name as "unitName",
- tmgs.sub_unit_id as "subUnitId",
- tmgs.conversion_factor as "conversionFactor",
- tmgs.series_id as "seriesId",
- tmgseries.series_name as "seriesName",
- tmgs.sku_spec as "skuSpec",
- tmgs.price_purchase as "pricePurchase",
- tmgs.price_standard as "priceStandard",
- tmgs.price_wholesale as "priceWholesale",
- tmgs.price_limited as "priceLimited",
- tmgs.sku_images as "skuImages",
- tmgs.remarks
- from dkic_b.t_mst_goods_sku as tmgs
- left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
- left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
- left join dkic_b.t_mst_goods_series as tmgseries on tmgs.series_id = tmgseries.series_id
- left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
- where tmgs.flg_valid
- AND tmgs.cp_id = #{cpId}
- <if test="skuCode != null">
- AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
- </if>
- <if test="skuName != null">
- AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
- </if>
- </select>
- <!-- 获取商品个数 -->
- <select id="getGoodsCountByPage" resultType="Long">
- SELECT
- count(1)
- from dkic_b.t_mst_goods_sku as tmgs
- where tmgs.flg_valid
- AND tmgs.cp_id = #{cpId}
- <if test="skuCode != null">
- AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
- </if>
- <if test="skuName != null">
- AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
- </if>
- </select>
- <!-- 获取商品 -->
- <select id="getGoodsForOrder" resultType="java.util.Map">
- select tmgs.sku_id as "skuId",
- tmgs.sku_code as "skuCode",
- tmgs.sku_name as "skuName",
- tmgs.sku_model as "skuModel",
- tmgs.brand_id as "brandId",
- tmgb.brand_name as "brandName",
- tmgs.category_id as "categoryId",
- tmgc.cat_name as "categoryName",
- tmgs.unit_id as "unitId",
- tmgu.unit_name as "unitName",
- tmgs.sub_unit_id as "subUnitId",
- tmgs.conversion_factor as "conversionFactor",
- tmgs.series_id as "seriesId",
- tmgseries.series_name as "seriesName",
- tmgs.sku_spec as "skuSpec",
- tmgs.price_purchase as "pricePurchase",
- tmgs.price_standard as "priceStandard",
- tmgs.price_wholesale as "priceWholesale",
- tmgs.price_limited as "priceLimited",
- tmgs.sku_images as "skuImages",
- tmgs.remarks
- from dkic_b.t_mst_goods_sku as tmgs
- left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
- left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
- left join dkic_b.t_mst_goods_series as tmgseries on tmgs.series_id = tmgseries.series_id
- left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
- where tmgs.flg_valid
- AND tmgs.cp_id = #{cpId}
- <if test="skuCode != null">
- AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
- </if>
- <if test="skuName != null">
- AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
- </if>
- </select>
- <!-- 获取商品个数 -->
- <select id="getGoodsForOrderCountByPage" resultType="Long">
- SELECT
- count(1)
- from dkic_b.t_mst_goods_sku as tmgs
- where tmgs.flg_valid
- AND tmgs.cp_id = #{cpId}
- <if test="skuCode != null">
- AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
- </if>
- <if test="skuName != null">
- AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
- </if>
- </select>
- <!-- 获取商品(采购) -->
- <select id="getGoodsForPurchase" resultType="java.util.Map">
- select tmgs.sku_id as "skuId",
- tmgs.sku_code as "skuCode",
- tmgs.sku_name as "skuName",
- tmgs.sku_model as "skuModel",
- tmgs.brand_id as "brandId",
- tmgb.brand_name as "brandName",
- tmgs.category_id as "categoryId",
- tmgc.cat_name as "categoryName",
- tmgs.unit_id as "unitId",
- tmgu.unit_name as "unitName",
- tmgs.sub_unit_id as "subUnitId",
- tmgs.conversion_factor as "conversionFactor",
- tmgs.series_id as "seriesId",
- tmgseries.series_name as "seriesName",
- tmgs.sku_spec as "skuSpec",
- tmgs.price_purchase as "pricePurchase",
- tmgs.price_standard as "priceStandard",
- tmgs.price_wholesale as "priceWholesale",
- tmgs.price_limited as "priceLimited",
- tmgs.sku_images as "skuImages",
- tmgs.remarks
- from dkic_b.t_mst_goods_sku as tmgs
- left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
- left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
- left join dkic_b.t_mst_goods_series as tmgseries on tmgs.series_id = tmgseries.series_id
- left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
- where tmgs.flg_valid
- AND tmgs.cp_id = #{cpId}
- <if test="skuCode != null">
- AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
- </if>
- <if test="skuName != null">
- AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
- </if>
- </select>
- <!-- 获取商品个数(采购) -->
- <select id="getGoodsForPurchaseCountByPage" resultType="Long">
- SELECT
- count(1)
- from dkic_b.t_mst_goods_sku as tmgs
- where tmgs.flg_valid
- AND tmgs.cp_id = #{cpId}
- <if test="skuCode != null">
- AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
- </if>
- <if test="skuName != null">
- AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
- </if>
- </select>
- <!-- 获取客户 -->
- <select id="getCustomer" resultType="java.util.Map">
- select tmc.cus_id as "cusId",
- tmc.cus_code as "cusCode",
- tmc.cus_name as "cusName",
- tmc.cus_phone as "cusPhone",
- tmc.address_area as "addressArea",
- tmc.address_name as "addressName",
- tmc.address_no as "addressNo",
- tmc.address_gcj02 as "addressGcj02",
- tmc.address_full as "addressFull",
- tmc.contact_name as "contactName",
- tmc.contact_phone as "contactPhone",
- tmc.cus_from as "cusFrom",
- tmdd.data_value as "cusFromName",
- tmc.channel_id as "channelId",
- tmsc.channel_name as "channelName",
- tmc.org_id as "orgId",
- tmo.org_name as "orgName",
- tmc.staff_id as "staffId",
- tms.staff_name as "staffName",
- tmc.report_staff as "reportStaff",
- reportstaff.staff_name as "reportStaffName",
- tmc.report_time as "reportTime",
- tmc.sale_status as "saleStatus",
- tmc.remarks as "remarks",
- tmc.follow_staffs as "followStaffs",
- tmc.last_follow_staff as "lastFollowStaff",
- tmc.last_follow_id as "lastFollowId",
- tmc.last_follow_status as "lastFollowStatus",
- tmc.last_follow_time as "lastFollowTime"
- from dkic_b.t_mst_customer as tmc
- inner join dkic_b.t_mst_org tmo on tmc.org_id = tmo.org_id
- inner join dkic_b.t_mst_staff tms on tmc.staff_id = tms.staff_id
- inner join dkic_b.t_mst_staff as reportstaff on tmc.report_staff = reportstaff.staff_id
- inner join dkic_b.t_mst_sale_channel tmsc on tmc.channel_id = tmsc.channel_id
- left join dkic_b.t_mst_dictionary_data tmdd on tmc.cus_from = tmdd.data_id
- where tmc.flg_valid
- AND tmc.cp_id = #{cpId}
- <if test="skuCode != null">
- AND tmc.cus_code = #{cusCode}
- </if>
- <if test="skuName != null">
- AND tmc.cus_name = #{cusName}
- </if>
- </select>
- <!-- 获取客户个数 -->
- <select id="getCustomerCountByPage" resultType="Long">
- SELECT
- count(1)
- from dkic_b.t_mst_customer as tmc
- where tmc.flg_valid
- and tmc.cp_id = #{cpId}
- <if test="skuCode != null">
- AND tmc.cus_code = #{cusCode}
- </if>
- <if test="skuName != null">
- AND tmc.cus_name = #{cusName}
- </if>
- </select>
- <!-- 获取单据Id-->
- <select id="getUuidSeq" resultType="object">
- select sys.f_uuid_seq()
- </select>
- <!-- 获取单据单号-->
- <select id="getDocNo" resultType="java.lang.String">
- select dkic_b.f_create_note(#{cpId}, #{purId}::uuid, #{docCode})
- </select>
- <!--获取供应商-->
- <select id="getSupplier" resultType="java.util.Map">
- select tms.sup_code as "supplierCode",
- tms.sup_name as "supplierName",
- tms.sup_id as "supplierId",
- sys.f_get_name_i18n(tdk.kind_name_i18n,'zh_CN' ) AS "supplierType",
- tms.contact_name as "contactName",
- tms.contact_phone as "contactPhone",
- tms.flg_valid as "flgValid"
- from dkic_b.t_mst_supplier tms
- LEFT JOIN sys.t_data_kind tdk
- ON tdk.kind_code = tms.sup_type
- where tms.cp_id = #{cpId}
- <if test="supplierName!=null and supplierName!=''">
- AND tms.sup_name LIKE concat('%',my_ex.likequery(#{supplierName}),'%')
- </if>
- <if test="supplierCode!=null and supplierCode!=''">
- AND tms.sup_code LIKE concat('%',my_ex.likequery(#{supplierCode}),'%')
- </if>
- <if test="supplierType!=null and supplierType!=''">
- AND tms.sup_type = #{supplierType}
- </if>
- order by tms.sup_code
- <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
- limit #{end} offset #{start}
- </if>
- <if test="limit != null and limit != 0 ">
- limit #{limit}
- </if>
- </select>
- <!--获取供应商数量-->
- <select id="countSupplier" resultType="java.lang.Long">
- select count(1)
- from dkic_b.t_mst_supplier tms
- LEFT JOIN sys.t_data_kind tdk
- ON tdk.kind_code = tms.sup_type
- where tms.cp_id = #{cpId}
- <if test="supplierName!=null and supplierName!=''">
- AND tms.sup_name LIKE concat('%',my_ex.likequery(#{supplierName}),'%')
- </if>
- <if test="supplierCode!=null and supplierCode!=''">
- AND tms.sup_code LIKE concat('%',my_ex.likequery(#{supplierCode}),'%')
- </if>
- <if test="supplierType!=null and supplierType!=''">
- AND tms.sup_type LIKE concat('%',my_ex.likequery(#{supplierType}),'%')
- </if>
- </select>
- <!--获取渠道 -->
- <select id="getChannel" resultType="java.util.Map">
- select c.channel_id as "channelId",
- c.channel_code as "channelCode",
- c.channel_name as "channelName",
- c.sys_code as "sysCode",
- c.display_no as "displayNo"
- from dkic_b.t_mst_sale_channel as c
- where c.flg_valid
- and c.cp_id = #{cpId}
- <if test="channel_code!=null and channel_code!=''">
- AND c.channel_code LIKE concat('%', #{channelCode}, '%')
- </if>
- <if test="channel_name!=null and channel_name!=''">
- AND c.channel_name LIKE concat('%', #{channelName}, '%')
- </if>
- order by c.display_no
- <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
- limit #{end} offset #{start}
- </if>
- <if test="limit != null and limit != 0 ">
- limit #{limit}
- </if>
- </select>
- <!-- 查询商品档案-->
- <select id="getGoodsBrand" resultType="java.util.Map">
- SELECT
- tmgb.flg_valid AS "flgValid",
- tmgb.brand_id AS "brandId", tmgb.brand_code AS "brandCode", tmgb.brand_name AS "brandName",
- (SELECT COALESCE(array_to_string(array_agg(tsm.sup_name), ','),'')
- FROM dkic_b.t_mst_supplier_brand tsmb
- left join dkic_b.t_mst_supplier tsm on tsm.sup_id = tsmb.sup_id
- WHERE tsmb.brand_id = tmgb.brand_id) AS "supplierName"
- FROM dkic_b.t_mst_goods_brand tmgb
- <where>
- <if test="searchText !=null">
- AND tmgb.brand_name LIKE concat('%',my_ex.likequery(#{searchText}), '%')
- </if>
- <if test="cpId != null">
- AND tmgb.cp_id = #{cpId}
- </if>
- </where>
- order by tmgb.display_no asc
- <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
- limit #{end} offset #{start}
- </if>
- </select>
- <!-- 查询表t_mst_goods_brand,(条件查询)个数 -->
- <select id="countGoodsBrand" resultType="Long">
- SELECT
- count(1)
- FROM dkic_b.t_mst_goods_brand tmgb
- <where>
- <if test="searchText !=null">
- AND tmgb.brand_name LIKE concat('%', #{searchText}, '%')
- </if>
- <if test="cpId != null">
- AND tmgb.cp_id = #{cpId}
- </if>
- </where>
- </select>
- <!-- 查询商品种类-->
- <select id="getGoodsCategory" resultType="java.util.Map">
- SELECT
- cat_id AS "catId",
- cat_code AS "catCode",
- cat_name AS "catName",
- parent_id AS "parentId",
- flg_valid AS "flgValid"
- FROM dkic_b.t_mst_goods_category
- <where>
- <if test="searchText !=null">
- AND ( cat_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
- or remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
- </if>
- <if test="cpId != null">
- AND cp_id = #{cpId}
- </if>
- </where>
- ORDER BY display_no
- <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
- limit #{end} offset #{start}
- </if>
- </select>
- <!-- 查询商品种类的个数-->
- <select id="countGoodsCategory" resultType="java.lang.Long">
- SELECT
- count(1)
- FROM dkic_b.t_mst_goods_category
- <where>
- <if test="searchText !=null">
- AND ( cat_name LIKE concat('%', #{searchText}, '%')
- or remarks LIKE concat('%', #{searchText}, '%'))
- </if>
- <if test="cpId != null">
- AND cp_id = #{cpId}
- </if>
- </where>
- </select>
- <!-- 查询商品系列-->
- <select id="getGoodsSeries" resultType="java.util.Map">
- SELECT
- series_id AS "seriesId",
- series_code AS "seriesCode",
- series_name AS "serieName",
- flg_valid AS "flgValid"
- FROM dkic_b.t_mst_goods_series
- <where>
- <if test="searchText !=null">
- AND ( series_name LIKE concat('%',my_ex.likequery(#{searchText}), '%')
- or remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
- </if>
- <if test="cpId != null">
- AND cp_id = #{cpId}
- </if>
- </where>
- order by display_no asc
- <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
- limit #{end} offset #{start}
- </if>
- </select>
- <!-- 商品系列个数-->
- <select id="countGoodsSeries" resultType="java.lang.Long">
- SELECT
- count(1)
- FROM dkic_b.t_mst_goods_series
- <where>
- <if test="searchText !=null">
- AND ( series_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
- or remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
- </if>
- <if test="cpId != null">
- AND cp_id = #{cpId}
- </if>
- </where>
- </select>
- <!-- 获取计量单位-->
- <select id="getUnit" resultType="java.util.Map">
- SELECT
- unit_id AS "unitId",
- unit_code AS "unitCode",
- unit_name AS "unitName",
- decimal_places AS "decimalPlaces",
- flg_valid AS "flgValid"
- FROM dkic_b.t_mst_unit
- <where>
- <if test="searchText !=null">
- AND ( unit_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
- or remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
- </if>
- <if test="cpId != null">
- AND cp_id = #{cpId}
- </if>
- </where>
- order by display_no asc
- <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
- limit #{end} offset #{start}
- </if>
- </select>
- <!-- 获取计量单位个数-->
- <select id="countUnit" resultType="java.lang.Long">
- SELECT
- count(1)
- FROM dkic_b.t_mst_unit
- <where>
- <if test="searchText !=null">
- AND ( unit_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
- or remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
- </if>
- <if test="cpId != null">
- AND cp_id = #{cpId}
- </if>
- </where>
- </select>
- <!--获取仓库档案-->
- <select id="getWarehouseByPage" resultType="java.util.Map">
- SELECT
- wh_id AS "whId",
- wh_code AS "whCode",
- wh_name AS "whName",
- supervisor AS "supervisor",
- contact_phone AS "contactPhone",
- flg_valid AS "flgValid"
- FROM dkic_b.t_mst_warehouse
- <where>
- <if test="searchText !=null">
- AND ( wh_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
- or remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
- </if>
- <if test="cpId != null">
- AND cp_id = #{cpId}
- </if>
- </where>
- order by display_no asc
- <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
- limit #{end} offset #{start}
- </if>
- </select>
- <!--获取仓库档案个数-->
- <select id="countWarehouseByPage" resultType="Long">
- SELECT
- count(1)
- FROM dkic_b.t_mst_warehouse
- <where>
- <if test="searchText !=null">
- AND ( wh_name LIKE concat('%', my_ex.likequery(#{searchText}), '%')
- or remarks LIKE concat('%', my_ex.likequery(#{searchText}), '%'))
- </if>
- <if test="cpId != null">
- AND cp_id = #{cpId}
- </if>
- </where>
- </select>
- <!-- 查询库存 -->
- <select id="getInventory" resultType="java.util.Map">
- select tpi.inv_id as "invId",
- tpi.sku_id as "skuId",
- tmgs.sku_code as "skuCode",
- tmgs.sku_name as "skuName",
- tmgs.sku_model as "skuModel",
- tmgs.brand_id as "brandId",
- tmgb.brand_name as "brandName",
- tmgs.category_id as "categoryId",
- tmgc.cat_name as "categoryName",
- tmgs.unit_id as "unitId",
- tmgu.unit_name as "unitName",
- tmgs.sub_unit_id as "subUnitId",
- tmgs.conversion_factor as "conversionFactor",
- tmgs.series_id as "seriesId",
- tmgseries.series_name as "seriesName",
- tmgs.sku_spec as "skuSpec",
- tmgs.price_purchase as "pricePurchase",
- tmgs.price_standard as "priceStandard",
- tmgs.price_wholesale as "priceWholesale",
- tmgs.price_limited as "priceLimited",
- tmgs.sku_images as "skuImages",
- tpi.non_std_code as "nonStdCode",
- tpi.inv_qty as "invQty",
- tpi.outing_qty as "outingQty",
- tpi.usable_qty as "usableQty",
- tpi.wh_id as "whId",
- tmw.wh_code as "whCode",
- tmw.wh_name as "whName",
- tpi.remarks
- from dkic_b.t_psi_inventory as tpi
- inner join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
- inner join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpi.sku_id
- left join dkic_b.t_mst_goods_brand as tmgb on tmgs.brand_id = tmgb.brand_id
- left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
- left join dkic_b.t_mst_goods_series as tmgseries on tmgs.series_id = tmgseries.series_id
- left join dkic_b.t_mst_unit as tmgu on tmgs.unit_id = tmgu.unit_id
- where tpi.flg_valid
- AND tpi.cp_id = #{cpId}
- <if test="skuId != null">
- AND tpi.sku_id = #{skuId} ::uuid
- </if>
- <if test="nonStdCode != null">
- AND tpi.non_std_code = #{nonStdCode}
- </if>
- <if test="skuCode != null">
- AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
- </if>
- <if test="skuName != null">
- AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
- </if>
- <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>
- <!-- 查询库存个数 -->
- <select id="getInventoryCountByPage" resultType="Long">
- SELECT
- count(1)
- from dkic_b.t_psi_inventory as tpi
- inner join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
- inner join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpi.sku_id
- where tpi.flg_valid
- AND tpi.cp_id = #{cpId}
- <if test="skuId != null">
- AND tpi.sku_id = #{skuId} ::uuid
- </if>
- <if test="nonStdCode != null">
- AND tpi.non_std_code = #{nonStdCode}
- </if>
- <if test="skuCode != null">
- AND tmgs.sku_code LIKE concat('%',my_ex.likequery(#{skuCode}),'%')
- </if>
- <if test="skuName != null">
- AND tmgs.sku_name LIKE concat('%',my_ex.likequery(#{skuName}),'%')
- </if>
- <if test="whName != null">
- AND tmgs.wh_name LIKE concat('%',my_ex.likequery(#{whName}),'%')
- </if>
- </select>
- <!-- 获取销售渠道-->
- <select id="getSaleChannel" resultType="java.util.Map">
- SELECT
- channel_id AS "channelId",
- channel_id AS "id",
- channel_code AS "channelCode",
- channel_name AS "channelName"
- FROM dkic_b.t_mst_sale_channel
- <where>
- <if test="cpId != null">
- AND cp_id = #{cpId}
- </if>
- </where>
- </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"
- 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>
- </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>
|