| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?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.ruoyi.system.mapper.PosStoreOmgMapper">
- <!-- 按门店ID查 OMG 凭证(发起支付 getEnabledCredential 用) -->
- <select id="selectByStoreId" parameterType="Long"
- resultType="com.ruoyi.system.domain.PosStoreOmg">
- SELECT id, store_id AS storeId, omg_status AS omgStatus, is_enabled AS isEnabled,
- merchant_id AS merchantId, hash_key AS hashKey, hash_iv AS hashIv,
- enabled_payments AS enabledPayments, apply_time AS applyTime,
- approved_time AS approvedTime, last_verify_result AS lastVerifyResult,
- remark, create_time AS createTime, update_time AS updateTime,
- create_by AS createBy, update_by AS updateBy
- FROM pos_store_omg
- WHERE store_id = #{storeId}
- </select>
- <!-- 按 OMG 商店代号反查凭证(回调 MerchantID 定位门店) -->
- <select id="selectByMerchantId" parameterType="String"
- resultType="com.ruoyi.system.domain.PosStoreOmg">
- SELECT id, store_id AS storeId, omg_status AS omgStatus, is_enabled AS isEnabled,
- merchant_id AS merchantId, hash_key AS hashKey, hash_iv AS hashIv,
- enabled_payments AS enabledPayments, apply_time AS applyTime,
- approved_time AS approvedTime, last_verify_result AS lastVerifyResult,
- remark, create_time AS createTime, update_time AS updateTime,
- create_by AS createBy, update_by AS updateBy
- FROM pos_store_omg
- WHERE merchant_id = #{merchantId}
- ORDER BY id DESC
- LIMIT 1
- </select>
- <!-- 按 merchant_id + store_id 精确反查凭证(退款/查询补单:同 merchant_id 多门店时定位本店) -->
- <select id="selectByMerchantIdAndStoreId" parameterType="map"
- resultType="com.ruoyi.system.domain.PosStoreOmg">
- SELECT id, store_id AS storeId, omg_status AS omgStatus, is_enabled AS isEnabled,
- merchant_id AS merchantId, hash_key AS hashKey, hash_iv AS hashIv,
- enabled_payments AS enabledPayments, apply_time AS applyTime,
- approved_time AS approvedTime, last_verify_result AS lastVerifyResult,
- remark, create_time AS createTime, update_time AS updateTime,
- create_by AS createBy, update_by AS updateBy
- FROM pos_store_omg
- WHERE merchant_id = #{merchantId}
- AND store_id = #{storeId}
- ORDER BY id DESC
- LIMIT 1
- </select>
- <!-- 门店 OMG 凭证管理列表:列名别名对齐 VO 属性,resultType 自动映射 -->
- <select id="selectOmgStoreList" parameterType="com.ruoyi.system.domain.vo.PosStoreOmgVo"
- resultType="com.ruoyi.system.domain.vo.PosStoreOmgVo">
- SELECT
- s.id AS storeId,
- s.pos_name AS posName,
- s.user_id AS userId,
- u.user_name AS userName,
- s.is_stall AS isStall,
- s.is_night_market AS isNightMarket,
- s.night_market_id AS nightMarketId,
- IFNULL(e.omg_status, 0) AS omgStatus,
- IFNULL(e.is_enabled, 1) AS isEnabled,
- CASE WHEN e.merchant_id IS NULL OR e.merchant_id = '' THEN 0 ELSE 1 END AS hasMerchantId,
- e.enabled_payments AS enabledPayments,
- e.apply_time AS applyTime,
- e.approved_time AS approvedTime,
- e.last_verify_result AS lastVerifyResult
- FROM pos_store s
- LEFT JOIN pos_store_omg e ON e.store_id = s.id
- LEFT JOIN info_user u ON u.user_id = s.user_id
- <where>
- s.del_flag = '0'
- <if test="posNameLike != null and posNameLike != ''"> AND s.pos_name LIKE concat('%', #{posNameLike}, '%') </if>
- <if test="omgStatus != null"> AND IFNULL(e.omg_status, 0) = #{omgStatus} </if>
- <if test="quickFilter != null and quickFilter == 'notApplied'">
- AND IFNULL(e.omg_status, 0) IN (0, 1)
- </if>
- </where>
- ORDER BY s.id DESC
- </select>
- <!-- 门店 OMG 凭证详情 -->
- <select id="selectOmgStoreDetail" parameterType="Long"
- resultType="com.ruoyi.system.domain.vo.PosStoreOmgVo">
- SELECT
- s.id AS storeId,
- s.pos_name AS posName,
- s.user_id AS userId,
- u.user_name AS userName,
- s.is_stall AS isStall,
- s.is_night_market AS isNightMarket,
- s.night_market_id AS nightMarketId,
- IFNULL(e.omg_status, 0) AS omgStatus,
- IFNULL(e.is_enabled, 1) AS isEnabled,
- CASE WHEN e.merchant_id IS NULL OR e.merchant_id = '' THEN 0 ELSE 1 END AS hasMerchantId,
- e.merchant_id AS merchantId,
- e.enabled_payments AS enabledPayments,
- e.remark AS remark,
- e.apply_time AS applyTime,
- e.approved_time AS approvedTime,
- e.last_verify_result AS lastVerifyResult
- FROM pos_store s
- LEFT JOIN pos_store_omg e ON e.store_id = s.id
- LEFT JOIN info_user u ON u.user_id = s.user_id
- WHERE s.id = #{storeId}
- </select>
- </mapper>
|