统一修改ruoyi->bms
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
<?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.bms.system.mapper.BmsExchangeRateMapper">
|
||||
|
||||
<resultMap type="BmsExchangeRate" id="BmsExchangeRateResult">
|
||||
<id property="rateId" column="rate_id" />
|
||||
<result property="fromCurrency" column="from_currency" />
|
||||
<result property="toCurrency" column="to_currency" />
|
||||
<result property="rateType" column="rate_type" />
|
||||
<result property="exchangeRate" column="exchange_rate" />
|
||||
<result property="effectiveDate" column="effective_date" />
|
||||
<result property="expireDate" column="expire_date" />
|
||||
<result property="source" column="source" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectExchangeRateVo">
|
||||
select rate_id, from_currency, to_currency, rate_type, exchange_rate, effective_date, expire_date,
|
||||
source, remark, create_by, create_time, del_flag
|
||||
from sys_exchange_rate
|
||||
</sql>
|
||||
|
||||
<select id="selectExchangeRateList" parameterType="BmsExchangeRate" resultMap="BmsExchangeRateResult">
|
||||
<include refid="selectExchangeRateVo"/>
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="fromCurrency != null and fromCurrency != ''"> and from_currency = #{fromCurrency}</if>
|
||||
<if test="toCurrency != null and toCurrency != ''"> and to_currency = #{toCurrency}</if>
|
||||
<if test="rateType != null and rateType != ''"> and rate_type = #{rateType}</if>
|
||||
<if test="source != null and source != ''"> and source like concat('%', #{source}, '%')</if>
|
||||
<if test="params != null and params.beginTime != null and params.beginTime != ''">
|
||||
and effective_date >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params != null and params.endTime != null and params.endTime != ''">
|
||||
and effective_date <= #{params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by effective_date desc, rate_type asc, rate_id desc
|
||||
</select>
|
||||
|
||||
<select id="selectExchangeRateById" parameterType="Long" resultMap="BmsExchangeRateResult">
|
||||
<include refid="selectExchangeRateVo"/>
|
||||
where rate_id = #{rateId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectEffectiveRate" resultMap="BmsExchangeRateResult">
|
||||
<include refid="selectExchangeRateVo"/>
|
||||
where del_flag = '0'
|
||||
and from_currency = #{fromCurrency}
|
||||
and to_currency = #{toCurrency}
|
||||
<if test="rateType != null and rateType != ''">and rate_type = #{rateType}</if>
|
||||
and effective_date <= #{bizDate}
|
||||
and (expire_date is null or expire_date >= #{bizDate})
|
||||
order by effective_date desc, rate_id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="countDuplicate" resultType="int">
|
||||
select count(1) from sys_exchange_rate
|
||||
where del_flag = '0'
|
||||
and from_currency = #{fromCurrency}
|
||||
and to_currency = #{toCurrency}
|
||||
and rate_type = #{rateType}
|
||||
and effective_date = #{effectiveDate}
|
||||
<if test="excludeId != null">and rate_id != #{excludeId}</if>
|
||||
</select>
|
||||
|
||||
<insert id="insertExchangeRate" parameterType="BmsExchangeRate" useGeneratedKeys="true" keyProperty="rateId">
|
||||
insert into sys_exchange_rate (
|
||||
from_currency, to_currency, rate_type, exchange_rate, effective_date, expire_date,
|
||||
source, remark, create_by, create_time, del_flag
|
||||
) values (
|
||||
#{fromCurrency}, #{toCurrency}, #{rateType}, #{exchangeRate}, #{effectiveDate}, #{expireDate},
|
||||
#{source}, #{remark}, #{createBy}, sysdate(), '0'
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateExchangeRate" parameterType="BmsExchangeRate">
|
||||
update sys_exchange_rate
|
||||
<set>
|
||||
<if test="fromCurrency != null and fromCurrency != ''">from_currency = #{fromCurrency},</if>
|
||||
<if test="toCurrency != null and toCurrency != ''">to_currency = #{toCurrency},</if>
|
||||
<if test="rateType != null and rateType != ''">rate_type = #{rateType},</if>
|
||||
<if test="exchangeRate != null">exchange_rate = #{exchangeRate},</if>
|
||||
<if test="effectiveDate != null">effective_date = #{effectiveDate},</if>
|
||||
expire_date = #{expireDate},
|
||||
<if test="source != null">source = #{source},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</set>
|
||||
where rate_id = #{rateId}
|
||||
</update>
|
||||
|
||||
<update id="deleteExchangeRateByIds" parameterType="Long">
|
||||
update sys_exchange_rate set del_flag = '1' where rate_id in
|
||||
<foreach item="rateId" collection="array" open="(" separator="," close=")">
|
||||
#{rateId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,184 @@
|
||||
<?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.bms.system.mapper.BmsRegionMapper">
|
||||
|
||||
<resultMap type="BmsRegion" id="BmsRegionResult">
|
||||
<id property="regionId" column="region_id" />
|
||||
<result property="countryNameCn" column="country_name_cn" />
|
||||
<result property="countryNameEn" column="country_name_en" />
|
||||
<result property="countryCode2" column="country_code_2" />
|
||||
<result property="countryCode3" column="country_code_3" />
|
||||
<result property="continent" column="continent" />
|
||||
<result property="subRegion" column="sub_region" />
|
||||
<result property="currencyCode" column="currency_code" />
|
||||
<result property="currencyName" column="currency_name" />
|
||||
<result property="currencySymbol" column="currency_symbol" />
|
||||
<result property="phonePrefix" column="phone_prefix" />
|
||||
<result property="flagEmoji" column="flag_emoji" />
|
||||
<result property="flagUrl" column="flag_url" />
|
||||
<result property="isIndependent" column="is_independent" />
|
||||
<result property="isEu" column="is_eu" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRegionVo">
|
||||
select region_id, country_name_cn, country_name_en, country_code_2, country_code_3,
|
||||
continent, sub_region, currency_code, currency_name, currency_symbol,
|
||||
phone_prefix, flag_emoji, flag_url, is_independent, is_eu,
|
||||
status, del_flag, create_by, create_time, update_by, update_time, remark
|
||||
from bms_region
|
||||
</sql>
|
||||
|
||||
<select id="selectRegionById" parameterType="Long" resultMap="BmsRegionResult">
|
||||
<include refid="selectRegionVo"/>
|
||||
where region_id = #{regionId}
|
||||
</select>
|
||||
|
||||
<select id="selectRegionByCode2" parameterType="String" resultMap="BmsRegionResult">
|
||||
<include refid="selectRegionVo"/>
|
||||
where country_code_2 = #{countryCode2} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectRegionByNameCn" parameterType="String" resultMap="BmsRegionResult">
|
||||
<include refid="selectRegionVo"/>
|
||||
where del_flag = '0' and country_name_cn = #{countryNameCn} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectRegionList" parameterType="BmsRegion" resultMap="BmsRegionResult">
|
||||
<include refid="selectRegionVo"/>
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="countryNameCn != null and countryNameCn != ''">
|
||||
AND country_name_cn like concat('%', #{countryNameCn}, '%')
|
||||
</if>
|
||||
<if test="countryNameEn != null and countryNameEn != ''">
|
||||
AND country_name_en like concat('%', #{countryNameEn}, '%')
|
||||
</if>
|
||||
<if test="countryCode2 != null and countryCode2 != ''">
|
||||
AND country_code_2 like concat('%', #{countryCode2}, '%')
|
||||
</if>
|
||||
<if test="continent != null and continent != ''">
|
||||
AND continent = #{continent}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by region_id
|
||||
</select>
|
||||
|
||||
<insert id="insertRegion" parameterType="BmsRegion" useGeneratedKeys="true" keyProperty="regionId">
|
||||
insert into bms_region (
|
||||
<if test="countryNameCn != null">country_name_cn,</if>
|
||||
<if test="countryNameEn != null and countryNameEn != ''">country_name_en,</if>
|
||||
<if test="countryCode2 != null and countryCode2 != ''">country_code_2,</if>
|
||||
<if test="countryCode3 != null">country_code_3,</if>
|
||||
<if test="continent != null">continent,</if>
|
||||
<if test="subRegion != null">sub_region,</if>
|
||||
<if test="currencyCode != null">currency_code,</if>
|
||||
<if test="currencyName != null">currency_name,</if>
|
||||
<if test="currencySymbol != null">currency_symbol,</if>
|
||||
<if test="phonePrefix != null">phone_prefix,</if>
|
||||
<if test="flagEmoji != null">flag_emoji,</if>
|
||||
<if test="flagUrl != null">flag_url,</if>
|
||||
<if test="isIndependent != null and isIndependent != ''">is_independent,</if>
|
||||
<if test="isEu != null and isEu != ''">is_eu,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
create_time
|
||||
) values (
|
||||
<if test="countryNameCn != null">#{countryNameCn},</if>
|
||||
<if test="countryNameEn != null and countryNameEn != ''">#{countryNameEn},</if>
|
||||
<if test="countryCode2 != null and countryCode2 != ''">#{countryCode2},</if>
|
||||
<if test="countryCode3 != null">#{countryCode3},</if>
|
||||
<if test="continent != null">#{continent},</if>
|
||||
<if test="subRegion != null">#{subRegion},</if>
|
||||
<if test="currencyCode != null">#{currencyCode},</if>
|
||||
<if test="currencyName != null">#{currencyName},</if>
|
||||
<if test="currencySymbol != null">#{currencySymbol},</if>
|
||||
<if test="phonePrefix != null">#{phonePrefix},</if>
|
||||
<if test="flagEmoji != null">#{flagEmoji},</if>
|
||||
<if test="flagUrl != null">#{flagUrl},</if>
|
||||
<if test="isIndependent != null and isIndependent != ''">#{isIndependent},</if>
|
||||
<if test="isEu != null and isEu != ''">#{isEu},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateRegion" parameterType="BmsRegion">
|
||||
update bms_region
|
||||
<set>
|
||||
<if test="countryNameCn != null">country_name_cn = #{countryNameCn},</if>
|
||||
<if test="countryNameEn != null and countryNameEn != ''">country_name_en = #{countryNameEn},</if>
|
||||
<if test="countryCode2 != null and countryCode2 != ''">country_code_2 = #{countryCode2},</if>
|
||||
<if test="countryCode3 != null">country_code_3 = #{countryCode3},</if>
|
||||
<if test="continent != null">continent = #{continent},</if>
|
||||
<if test="subRegion != null">sub_region = #{subRegion},</if>
|
||||
<if test="currencyCode != null">currency_code = #{currencyCode},</if>
|
||||
<if test="currencyName != null">currency_name = #{currencyName},</if>
|
||||
<if test="currencySymbol != null">currency_symbol = #{currencySymbol},</if>
|
||||
<if test="phonePrefix != null">phone_prefix = #{phonePrefix},</if>
|
||||
<if test="flagEmoji != null">flag_emoji = #{flagEmoji},</if>
|
||||
<if test="flagUrl != null">flag_url = #{flagUrl},</if>
|
||||
<if test="isIndependent != null and isIndependent != ''">is_independent = #{isIndependent},</if>
|
||||
<if test="isEu != null and isEu != ''">is_eu = #{isEu},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where region_id = #{regionId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRegionByIds" parameterType="Long">
|
||||
delete from bms_region where region_id in
|
||||
<foreach item="regionId" collection="array" open="(" separator="," close=")">
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="upsertByCode2" parameterType="BmsRegion">
|
||||
insert into bms_region (
|
||||
country_name_cn, country_name_en, country_code_2, country_code_3,
|
||||
continent, sub_region, currency_code, currency_name, currency_symbol,
|
||||
phone_prefix, flag_emoji, flag_url, is_independent, is_eu,
|
||||
status, del_flag, create_by, create_time
|
||||
) values (
|
||||
#{countryNameCn}, #{countryNameEn}, #{countryCode2}, #{countryCode3},
|
||||
#{continent}, #{subRegion}, #{currencyCode}, #{currencyName}, #{currencySymbol},
|
||||
#{phonePrefix}, #{flagEmoji}, #{flagUrl}, #{isIndependent}, #{isEu},
|
||||
#{status}, '0', #{createBy}, sysdate()
|
||||
)
|
||||
on duplicate key update
|
||||
country_name_cn = values(country_name_cn),
|
||||
country_name_en = values(country_name_en),
|
||||
country_code_3 = values(country_code_3),
|
||||
continent = values(continent),
|
||||
sub_region = values(sub_region),
|
||||
currency_code = values(currency_code),
|
||||
currency_name = values(currency_name),
|
||||
currency_symbol = values(currency_symbol),
|
||||
phone_prefix = values(phone_prefix),
|
||||
flag_emoji = values(flag_emoji),
|
||||
flag_url = values(flag_url),
|
||||
is_independent = values(is_independent),
|
||||
is_eu = values(is_eu),
|
||||
update_by = #{updateBy},
|
||||
update_time = sysdate()
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?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.bms.system.mapper.BmsRegionSyncLogMapper">
|
||||
|
||||
<resultMap type="BmsRegionSyncLog" id="BmsRegionSyncLogResult">
|
||||
<id property="logId" column="log_id" />
|
||||
<result property="syncType" column="sync_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="totalCount" column="total_count" />
|
||||
<result property="insertCount" column="insert_count" />
|
||||
<result property="updateCount" column="update_count" />
|
||||
<result property="failCount" column="fail_count" />
|
||||
<result property="durationMs" column="duration_ms" />
|
||||
<result property="errorMsg" column="error_msg" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSyncLogVo">
|
||||
select log_id, sync_type, status, total_count, insert_count, update_count,
|
||||
fail_count, duration_ms, error_msg, create_by, create_time, update_by, update_time
|
||||
from bms_region_sync_log
|
||||
</sql>
|
||||
|
||||
<select id="selectSyncLogById" parameterType="Long" resultMap="BmsRegionSyncLogResult">
|
||||
<include refid="selectSyncLogVo"/>
|
||||
where log_id = #{logId}
|
||||
</select>
|
||||
|
||||
<select id="selectSyncLogList" parameterType="BmsRegionSyncLog" resultMap="BmsRegionSyncLogResult">
|
||||
<include refid="selectSyncLogVo"/>
|
||||
<where>
|
||||
<if test="syncType != null and syncType != ''">
|
||||
AND sync_type = #{syncType}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''">
|
||||
and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''">
|
||||
and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
order by log_id desc
|
||||
</select>
|
||||
|
||||
<insert id="insertSyncLog" parameterType="BmsRegionSyncLog" useGeneratedKeys="true" keyProperty="logId">
|
||||
insert into bms_region_sync_log (
|
||||
<if test="syncType != null and syncType != ''">sync_type,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="totalCount != null">total_count,</if>
|
||||
<if test="insertCount != null">insert_count,</if>
|
||||
<if test="updateCount != null">update_count,</if>
|
||||
<if test="failCount != null">fail_count,</if>
|
||||
<if test="durationMs != null">duration_ms,</if>
|
||||
<if test="errorMsg != null">error_msg,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
) values (
|
||||
<if test="syncType != null and syncType != ''">#{syncType},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="totalCount != null">#{totalCount},</if>
|
||||
<if test="insertCount != null">#{insertCount},</if>
|
||||
<if test="updateCount != null">#{updateCount},</if>
|
||||
<if test="failCount != null">#{failCount},</if>
|
||||
<if test="durationMs != null">#{durationMs},</if>
|
||||
<if test="errorMsg != null">#{errorMsg},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateSyncLog" parameterType="BmsRegionSyncLog">
|
||||
update bms_region_sync_log
|
||||
<set>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="totalCount != null">total_count = #{totalCount},</if>
|
||||
<if test="insertCount != null">insert_count = #{insertCount},</if>
|
||||
<if test="updateCount != null">update_count = #{updateCount},</if>
|
||||
<if test="failCount != null">fail_count = #{failCount},</if>
|
||||
<if test="durationMs != null">duration_ms = #{durationMs},</if>
|
||||
<if test="errorMsg != null">error_msg = #{errorMsg},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where log_id = #{logId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSyncLogByIds" parameterType="Long">
|
||||
delete from bms_region_sync_log where log_id in
|
||||
<foreach item="logId" collection="array" open="(" separator="," close=")">
|
||||
#{logId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user