init:米东项目初始化

This commit is contained in:
Yuan
2025-07-23 09:55:50 +08:00
commit 6b49fbfaca
355 changed files with 392953 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?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.saye.hospitalgd.mapper.BankbillGetinfoMapper">
<!--插入银行交易记录-->
<insert id="insertBankbillGetinfo" parameterType="HashMap">
insert into bankbill_getinfo(trade_date, quartz_id, quartz_name, is_ok, modify_time, bill_table_name,
thirdConfigId)
values (#{trade_date}, #{quartz_id}, #{quartz_name}, #{is_ok}, #{modify_time}, #{bill_table_name},
#{thirdConfigId})
ON DUPLICATE KEY UPDATE quartz_id=values(quartz_id),
quartz_name=values(quartz_name),
is_ok=values(is_ok),
modify_time=values(modify_time),
thirdConfigId=values(thirdConfigId)
</insert>
<!--查询银行对账单下载记录-->
<select id="findBankbillGetinfoList" parameterType="HashMap" resultType="HashMap">
select trade_date,quartz_id,quartz_name,is_ok,modify_time,bill_table_name,thirdConfigId from bankbill_getinfo
<where>
<if test="startTime!=null and startTime!=''">
and trade_date &gt;=#{startTime}
</if>
<if test="startTime!=null and startTime!=''">
and trade_date &lt;=#{endTime}
</if>
<if test="is_ok!=null and is_ok!=''">
and is_ok =#{is_ok}
</if>
</where>
order by trade_date desc
</select>
<!--根据id查询银行对账单下载记录-->
<select id="findBankbillGetinfoById" parameterType="HashMap" resultType="HashMap">
select trade_date, quartz_id, quartz_name, is_ok, modify_time, bill_table_name, thirdConfigId
from bankbill_getinfo
where trade_date = #{trade_date}
and bill_table_name = #{bill_table_name}
</select>
<select id="findBankbillGetinfoByParam" parameterType="HashMap" resultType="HashMap">
select trade_date, quartz_id, quartz_name, is_ok, modify_time, bill_table_name, thirdConfigId
from bankbill_getinfo
where trade_date = #{trade_date}
and is_ok = #{is_ok}
</select>
</mapper>

View File

@@ -0,0 +1,269 @@
<?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.saye.hospitalgd.mapper.BankbillHistoryMapper">
<!--根据id查询记录-->
<select id="findBankbillHistoryById" parameterType="HashMap" resultType="HashMap">
select I_JYRQ
, I_JYSJ
, I_JZRQ
, I_YHLSH
, I_SHLSH
, I_DDH
, I_DDZT
, I_FKFZH
, I_FKFHM
, I_DDJE
, I_JYJE
, I_SXF
, I_JSJE
, I_GTDM
, I_FXK
, I_ZFKZ
, I_JYLX
, I_QS
from bankbills_history
where I_DDH = #{i_ddh}
</select>
<!--批量插入银行交易记录-->
<insert id="insertAllBankHistory" parameterType="java.util.List">
insert into
bankBill_History(C_QSRQ,C_JYRQ,C_JYSJ,C_ZDH,C_CARD,C_JYLX,C_JYJE,C_QSJE,C_SXF,C_SJZFJE,C_CKH,C_LSH,C_KLX,C_FKH,C_ZFFS,C_YSDDH,C_SHDDH,C_BZZD,C_QBYHJE,C_SHYHJE,C_YJYLSH,C_FQQS,C_FQSXF,C_FQFWF,C_FQFXF,C_QTYHJE,C_THDDH,C_FKFY,C_FDJC,C_ZDDH,bill_table_name)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.cQsrq},#{itm.cJyrq},#{itm.cJysj},#{itm.cZdh},#{itm.cCard},#{itm.cJylx},#{itm.cJyje},#{itm.cQsje},#{itm.cSxf},#{itm.cSjzfje},#{itm.cCkh},#{itm.cLsh},#{itm.cKlx}
,#{itm.cFkh},#{itm.cZffs},#{itm.cYsddh},#{itm.cShddh},#{itm.cBzzd},#{itm.cQbyhje},#{itm.cShyhje},#{itm.cYjylsh},#{itm.cFqqs},#{itm.cFqsxf},#{itm.cFqfwf},#{itm.cFqfxf},#{itm.cQtyhje},#{itm.cThddh},#{itm.cFkfy},#{itm.cFdjc},#{itm.cZddh},#{itm.billTableName}
)
</foreach>
</insert>
<select id="findBankbillHistoryList" parameterType="HashMap" resultType="HashMap">
select I_JYRQ
,I_JYSJ
,I_JZRQ
,I_YHLSH
,I_SHLSH
,I_DDH
,I_DDZT
,I_FKFZH
,I_FKFHM
,I_DDJE
,I_JYJE
,I_SXF
,I_JSJE
,I_GTDM
,I_FXK
,I_ZFKZ
,I_JYLX
,I_QS
from bankbills_history
<where>
<if test="startTime!=null and startTime!=''">
and I_JYRQ &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and I_JYRQ &lt;= #{endTime}
</if>
<if test="c_zffs!=null and c_zffs!=''">
and I_FXK = #{c_zffs}
</if>
<if test="likeFiled!=null and likeFiled!=''">
and I_DDH like concat('%',concat(#{likeFiled},'%'))
</if>
</where>
order by I_JYRQ,I_JYSJ
</select>
<!--获取支付方式 -->
<select id="findCzffs" resultType="HashMap">
select distinct c_zffs
from bankbill_history
</select>
<!--删除记录-->
<delete id="deleteBankbillHistoryByParam" parameterType="HashMap">
delete
from bankbill_history
where C_QSRQ = #{trade_date}
and bill_table_name = #{bill_table_name}
</delete>
<delete id="deleteTempTable">
delete
from temp_bankbill_history
</delete>
<!--将记录添加到临时表 对账是用交易日期而非清算日期-->
<insert id="findBankbillHistoryToTemp" parameterType="HashMap">
insert into temp_bankbill_history
select a.C_QSRQ,
C_JYRQ,
C_JYSJ,
C_ZDH,
C_CARD,
C_JYLX,
C_JYJE,
C_QSJE,
C_SXF,
C_SJZFJE,
C_CKH,
C_LSH,
C_KLX,
C_FKH,
C_ZFFS,
a.C_YSDDH,
C_SHDDH,
C_BZZD,
C_QBYHJE,
C_SHYHJE,
C_YJYLSH,
C_FQQS,
C_FQSXF,
C_FQFWF,
C_FQFXF,
C_QTYHJE,
C_THDDH,
C_FKFY,
C_FDJC,
C_ZDDH,
bill_table_name
from bankbill_history a
left join (select C_YSDDH from bankbill_history where C_JYLX = '2' and C_JYRQ = #{trade_date}) b
on a.C_YSDDH = b.C_YSDDH
where a.C_JYRQ = #{trade_date}
and b.C_YSDDH is null
</insert>
<select id="findBankbillHistoryByParam" parameterType="HashMap" resultType="HashMap">
select
C_QSRQ,C_JYRQ,C_JYSJ,C_ZDH,C_CARD,C_JYLX,C_JYJE,C_QSJE,C_SXF,C_SJZFJE,C_CKH,C_LSH,C_KLX,C_FKH,C_ZFFS,C_YSDDH,C_SHDDH,C_BZZD,C_QBYHJE,C_SHYHJE,C_YJYLSH,C_FQQS,C_FQSXF,C_FQFWF,C_FQFXF,C_QTYHJE,C_THDDH,C_FKFY,C_FDJC,C_ZDDH,bill_table_name
from bankbill_history
where C_JYRQ = #{trade_date}
<if test="c_ysddh!=null and c_ysddh!=''">
and C_YSDDH=#{c_ysddh}
</if>
<if test="c_jylx!=null and c_jylx!=''">
and C_JYLX=#{c_jylx}
</if>
<if test="orderby_je!=null and orderby_je!=''">
order by C_JYJE desc
</if>
</select>
<select id="findBankbillHistoryByTimeAndPlatformTransId" parameterType="HashMap" resultType="HashMap">
select C_QSRQ,
C_JYRQ,
C_JYSJ,
C_ZDH,
C_CARD,
C_JYLX,
C_JYJE,
C_QSJE,
C_SXF,
C_SJZFJE,
C_CKH,
C_LSH,
C_KLX,
C_FKH,
C_ZFFS,
C_YSDDH,
C_SHDDH,
C_BZZD,
C_QBYHJE,
C_SHYHJE,
C_YJYLSH,
C_FQQS,
C_FQSXF,
C_FQFWF,
C_FQFXF,
C_QTYHJE,
C_THDDH,
C_FKFY,
C_FDJC,
C_ZDDH,
bill_table_name
from bankbill_history
where C_JYRQ = #{searchTime}
and C_YSDDH = #{platformTransId}
</select>
<!--交易次数 此处查交易类型为收款的,也就是即使这笔交易退款也算交易次数-->
<select id="findBankBillNumByTime" parameterType="HashMap" resultType="HashMap">
select I_JYRQ, I_FXK, count(1) as num
from bankbills_history
where I_JYRQ &gt;= #{startTime}
and I_JYRQ &lt;= #{endTime}
and I_JYLX = '1'
group by I_FXK, I_JYRQ
order by I_FXK, I_JYRQ
</select>
<!-- 交易金额 此处统计所有数据计算金额 因为存在退款是退余额的情况 -->
<select id="findBankBillMoneyByTime" parameterType="HashMap" resultType="HashMap">
select I_JYRQ, I_FXK, sum(cast(I_JYJE as decimal(18, 2))) as money
from bankbills_history
where I_JYRQ &gt;= #{startTime}
and I_JYRQ &lt;= #{endTime}
group by I_FXK, I_JYRQ
order by I_FXK, I_JYRQ
</select>
<select id="findbankbillHistoryCount" parameterType="HashMap" resultType="HashMap">
select count(1) as num
from bankbill_history
where C_JYRQ &gt;= #{startTime}
and C_JYRQ &lt;= #{endTime}
</select>
<select id="findbankbillHistorySum" parameterType="HashMap" resultType="HashMap">
select IFNULL(sum(C_JYJE), 0) as Money
from bankbill_history
where C_JYRQ &gt;= #{startTime}
and C_JYRQ &lt;= #{endTime}
</select>
<insert id="insertBankbillOriginal" parameterType="HashMap">
insert into
bankbill_original(C_QSRQ,C_JYRQ,C_JYSJ,C_ZDH,C_CARD,C_JYLX,C_JYJE,C_QSJE,C_SXF,C_SJZFJE,C_CKH,C_LSH,C_KLX,C_FKH,C_ZFFS,C_YSDDH,C_SHDDH,C_BZZD,C_QBYHJE,C_SHYHJE,C_YJYLSH,C_FQQS,C_FQSXF,C_FQFWF,C_FQFXF,C_QTYHJE,C_THDDH,C_FKFY,C_FDJC,C_ZDDH,bill_table_name)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.cQsrq},#{itm.cJyrq},#{itm.cJysj},#{itm.cZdh},#{itm.cCard},#{itm.cJylx},#{itm.cJyje},#{itm.cQsje},#{itm.cSxf},#{itm.cSjzfje},#{itm.cCkh},#{itm.cLsh},#{itm.cKlx}
,#{itm.cFkh},#{itm.cZffs},#{itm.cYsddh},#{itm.cShddh},#{itm.cBzzd},#{itm.cQbyhje},#{itm.cShyhje},#{itm.cYjylsh},#{itm.cFqqs},#{itm.cFqsxf},#{itm.cFqfwf},#{itm.cFqfxf},#{itm.cQtyhje},#{itm.cThddh},#{itm.cFkfy},#{itm.cFdjc},#{itm.cZddh},#{itm.billTableName}
)
</foreach>
</insert>
<delete id="deleteBankbillOriginalByParam" parameterType="HashMap">
delete
from bankbill_original
where C_QSRQ = #{trade_date}
and bill_table_name = #{bill_table_name}
</delete>
<select id="findBankbillCountData" parameterType="HashMap" resultType="HashMap">
select count(1) as num,cast(IFNULL(sum(I_JYJE),0) as decimal(19,2)) as money
from bankbills_history
<where>
<if test="startTime!=null and startTime!=''">
and I_JYRQ &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and I_JYRQ &lt;= #{endTime}
</if>
<if test="c_zffs!=null and c_zffs!=''">
and I_FXK = #{c_zffs}
</if>
<if test="likeFiled!=null and likeFiled!=''">
and I_DDH like concat('%',concat(#{likeFiled},'%'))
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,216 @@
<?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.saye.hospitalgd.mapper.BankbillsHistoryMapper">
<select id="findBankbillHistoryByParam" parameterType="HashMap" resultType="HashMap">
select
I_JYRQ
,I_JYSJ
,I_JZRQ
,I_YHLSH
,I_SHLSH
,I_DDH
,I_DDZT
,I_FKFZH
,I_FKFHM
,I_DDJE
,I_JYJE
,I_SXF
,I_JSJE
,I_GTDM
,I_FXK
,I_ZFKZ
,I_JYLX
,I_QS
from bankbills_history
where I_JYRQ = #{trade_date}
<if test="i_ddh!=null and i_ddh!=''">
and I_DDH=#{i_ddh}
</if>
<if test="i_jylx!=null and i_jylx!=''">
and I_JYLX=#{i_jylx}
</if>
<if test="orderby_je!=null and orderby_je!=''">
order by I_JYJE desc
</if>
</select>
<select id="findBankBillsByDate" parameterType="HashMap" resultType="HashMap">
select I_JYRQ
, I_JYSJ
, I_JZRQ
, I_YHLSH
, I_SHLSH
, I_DDH
, I_DDZT
, I_FKFZH
, I_FKFHM
, I_DDJE
, I_JYJE
, I_SXF
, I_JSJE
, I_GTDM
, I_FXK
, I_ZFKZ
, I_JYLX
, I_QS
from bankbills_history
where I_JYRQ = #{trade_date}
</select>
<insert id="saveOriginalData" parameterType="java.util.List">
insert into bankbills_original (
I_JYRQ
,I_JYSJ
,I_JZRQ
,I_YHLSH
,I_SHLSH
,I_DDH
,I_DDZT
,I_FKFZH
,I_FKFHM
,I_DDJE
,I_JYJE
,I_SXF
,I_JSJE
,I_GTDM
,I_FXK
,I_ZFKZ
,I_JYLX
,I_QS
) values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.i_jyrq},#{itm.i_jysj},#{itm.i_jzrq},#{itm.i_yhlsh},#{itm.i_shlsh},#{itm.i_ddh},#{itm.i_ddzt},#{itm.i_fkfzh},#{itm.i_fkfhm},#{itm.i_ddje},#{itm.i_jyje},#{itm.i_sxf},#{itm.i_jsje}
,#{itm.i_gtdm},#{itm.i_fxk},#{itm.i_zfkz},#{itm.i_jylx},#{itm.i_qs}
)
</foreach>
</insert>
<insert id="saveHistoryData" parameterType="java.util.List">
insert into bankbills_history (
I_JYRQ
,I_JYSJ
,I_JZRQ
,I_YHLSH
,I_SHLSH
,I_DDH
,I_DDZT
,I_FKFZH
,I_FKFHM
,I_DDJE
,I_JYJE
,I_SXF
,I_JSJE
,I_GTDM
,I_FXK
,I_ZFKZ
,I_JYLX
,I_QS
) values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.i_jyrq},#{itm.i_jysj},#{itm.i_jzrq},#{itm.i_yhlsh},#{itm.i_shlsh},#{itm.i_ddh},#{itm.i_ddzt},#{itm.i_fkfzh},#{itm.i_fkfhm},#{itm.i_ddje},#{itm.i_jyje},#{itm.i_sxf},#{itm.i_jsje}
,#{itm.i_gtdm},#{itm.i_fxk},#{itm.i_zfkz},#{itm.i_jylx},#{itm.i_qs}
)
</foreach>
</insert>
<delete id="deleteOriginalByParam" parameterType="HashMap">
delete
from bankbills_original
where I_JYRQ = #{trade_date}
</delete>
<insert id="insertOriginal" parameterType="HashMap">
insert into
bankbills_original(
I_DZDRQ
,I_JTBH
,I_JTMC
,I_TYDWBH
,I_TYDWMC
,I_WXBH
,I_ZFBBH
,I_XSXXBZ
,I_JYRQ
,I_JYSJ
,I_SHRZZH
,I_POSBH
,I_JYLX
,I_JYQD
,I_JYFS
,I_GHDDH
,I_SHDDH
,I_DSFDDH
,I_GLDDH
,I_SXFQSFS
,I_DDZJE
,I_JYJE
,I_RZJE
,I_FKKH
,I_FKYH
,I_JDJBZ
,I_YHBS
,I_HBZL
,I_SHMC
,I_FY
)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.iDzdrq},#{itm.iJtbh},#{itm.iJtmc},#{itm.iTydwbh},#{itm.iTydwmc},#{itm.iWxbh},#{itm.iZfbbh},#{itm.iXsxxbz},#{itm.iJyrq},#{itm.iJysj},#{itm.iShrzzh},#{itm.iPosbh},#{itm.iJylx}
,#{itm.iJyqd},#{itm.iJyfs},#{itm.iGhddh},#{itm.iShddh},#{itm.iDsfddh},#{itm.iGlddh},#{itm.iSxfqsfs},#{itm.iDdzje}
,#{itm.iJyje},#{itm.iRzje},#{itm.iFkkh},#{itm.iFkyh},#{itm.iJdjbz},#{itm.iYhbs},#{itm.iHbzl},#{itm.iSpmc},#{itm.iFy})
</foreach>
</insert>
<!--删除记录-->
<delete id="deleteHistoryByParam" parameterType="HashMap">
delete
from bankbills_history
where I_JYRQ = #{trade_date}
</delete>
<!--批量插入银行交易记录-->
<insert id="insertHistory" parameterType="java.util.List">
insert into
bankbills_history(
I_DZDRQ
,I_JTBH
,I_JTMC
,I_TYDWBH
,I_TYDWMC
,I_WXBH
,I_ZFBBH
,I_XSXXBZ
,I_JYRQ
,I_JYSJ
,I_SHRZZH
,I_POSBH
,I_JYLX
,I_JYQD
,I_JYFS
,I_GHDDH
,I_SHDDH
,I_DSFDDH
,I_GLDDH
,I_SXFQSFS
,I_DDZJE
,I_JYJE
,I_RZJE
,I_FKKH
,I_FKYH
,I_JDJBZ
,I_YHBS
,I_HBZL
,I_SHMC
,I_FY)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.iDzdrq},#{itm.iJtbh},#{itm.iJtmc},#{itm.iTydwbh},#{itm.iTydwmc},#{itm.iWxbh},#{itm.iZfbbh},#{itm.iXsxxbz},#{itm.iJyrq},#{itm.iJysj},#{itm.iShrzzh},#{itm.iPosbh},#{itm.iJylx}
,#{itm.iJyqd},#{itm.iJyfs},#{itm.iGhddh},#{itm.iShddh},#{itm.iDsfddh},#{itm.iGlddh},#{itm.iSxfqsfs},#{itm.iDdzje}
,#{itm.iJyje},#{itm.iRzje},#{itm.iFkkh},#{itm.iFkyh},#{itm.iJdjbz},#{itm.iYhbs},#{itm.iHbzl},#{itm.iSpmc},#{itm.iFy})
</foreach>
</insert>
</mapper>

View File

@@ -0,0 +1,68 @@
<?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.saye.hospitalgd.mapper.quzrtz.BaseQuartzConfigMapper">
<resultMap id="BaseResultMap" type="com.saye.hospitalgd.model.BaseQuartzConfigEntity" >
<id column="CONFIGID" property="configId" jdbcType="VARCHAR" />
<result column="QUARTZ_NAME" property="quartzName" jdbcType="VARCHAR" />
<result column="QUARTZ_GROUP" property="quartzGroup" jdbcType="VARCHAR" />
<result column="STATUS" property="status" jdbcType="VARCHAR" />
<result column="QUARTZ_CLASS" property="quartzClass" jdbcType="VARCHAR" />
<result column="REMARK" property="remark" jdbcType="VARCHAR" />
<result column="CREATEUSERID" property="createUserId" jdbcType="VARCHAR" />
<result column="EXPRESSION" property="expression" jdbcType="VARCHAR" />
<result column="CREATE_TIME" property="createTime" jdbcType="VARCHAR" />
<result column="NAME" property="name" jdbcType="VARCHAR" />
</resultMap>
<!-- 查询所有任务 -->
<select id="findAll" parameterType="HashMap" resultMap="BaseResultMap">
select bqc.CONFIGID,bqc.QUARTZ_NAME,bqc.QUARTZ_GROUP,bqc.STATUS,bqc.QUARTZ_CLASS,bqc.REMARK,bqc.CREATEUSERID,bqc.EXPRESSION,bqc.CREATE_TIME from base_quartz_config bqc
<where>
<if test="part_name!=null and part_name!=''">
and bqc.QUARTZ_NAME like concat('%',concat(#{quartz_name},'%'))
</if>
<if test="part_type!=null and part_type!=''">
and bqc.CONFIGID = #{configId}
</if>
</where>
order by bqc.CONFIGID
</select>
<!-- 根据id查询定时任务 -->
<select id="findEntityById" resultMap="BaseResultMap">
select CONFIGID,QUARTZ_NAME,QUARTZ_GROUP,STATUS,QUARTZ_CLASS,REMARK,CREATEUSERID,EXPRESSION,CREATE_TIME from base_quartz_config
where CONFIGID=#{id}
</select>
<!-- 更新定时任务 -->
<update id="updateQuartzConfigByEntity" parameterType="com.saye.hospitalgd.model.BaseQuartzConfigEntity">
update base_quartz_config set QUARTZ_NAME=#{quartzName},QUARTZ_GROUP=#{quartzGroup},STATUS=#{status},QUARTZ_CLASS=#{quartzClass}
,REMARK=#{remark},CREATEUSERID=#{createUserId},EXPRESSION=#{expression}
where CONFIGID=#{configId}
</update>
<!-- 查询最大任务号 -->
<select id="findMaxId" resultType="hashMap">
select max(CONFIGID) as id from base_quartz_config
</select>
<!-- 删除任务 -->
<delete id="deleteQuartzConfigById">
delete from base_quartz_config where CONFIGID=#{id}
</delete>
<!-- 添加定时任务 -->
<insert id="addQuartz" parameterType="hashMap">
insert into base_quartz_config(configid, quartz_name, status, quartz_class, remark, createuserid, expression, create_time)
values(#{id},#{quartzName},#{status}, #{quartz_class}, #{remark}, #{createuserid}, #{expression}, #{create_time} )
</insert>
<!-- 更新定时任务信息 -->
<update id="updateQuartzConfigById">
update base_quartz_config set QUARTZ_NAME=#{quartzName},QUARTZ_GROUP=#{quartzGroup},QUARTZ_CLASS=#{quartzClass}
,REMARK=#{remark},EXPRESSION=#{expression}
where CONFIGID=#{configId}
</update>
</mapper>

View File

@@ -0,0 +1,187 @@
<?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.saye.hospitalgd.mapper.HisDetailMapper">
<select id="findHisDetail" parameterType="HashMap" resultType="HashMap">
select HisOperCode
,PayMethod
,TradingStatus
,BizType
,PayType
,TradeTime
,Amount
,PlatformTransId
,HisTransId
,PatientID
,PatientName
,trade_date
,source
from hisbills_history
<where>
<if test="payType!=null and payType!=''">
and PayType = #{payType}
</if>
<if test="startTime!=null and startTime!=''">
and trade_date &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and trade_date &lt;= #{endTime}
</if>
<if test="likeFiled!=null and likeFiled!=''">
and PlatformTransId like concat('%',concat(#{likeFiled},'%'))
</if>
</where>
order by trade_date,TradeTime
</select>
<delete id="deleteHisBillOriginalByParam" parameterType="HashMap">
delete from hisbill_original where trade_date=#{trade_date}
</delete>
<delete id="deleteHisBillOriginalWNByParam" parameterType="HashMap">
delete from hisbill_original_wn where trade_date=#{trade_date}
</delete>
<delete id="deleteHisBillOriginalHYByParam" parameterType="HashMap">
delete from hisbill_original_hy where trade_date=#{trade_date}
</delete>
<delete id="deleteHisBillByParam" parameterType="HashMap">
delete from hisbill_history where trade_date=#{trade_date}
</delete>
<insert id="insertAllHisBillOriginal" parameterType="java.util.List">
insert into
hisbill_original(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.payMethod},#{itm.tradingStatus},#{itm.bizType},#{itm.payType},#{itm.tradeTime},#{itm.hisOperCode},#{itm.amount},
#{itm.remarks},#{itm.platformTransId},#{itm.patientId},#{itm.patientName},#{itm.trade_date},#{itm.his_wsdl_id}
)
</foreach>
</insert>
<insert id="insertAllHisBillOriginalWN" parameterType="java.util.List">
insert into hisbill_original_wn(sjlx, hzxm, patid, jyje, tyje, zflsh, jyrq, sftkjl, zffs, jylx, czyh,
trade_date, his_wsdl_id)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.sjlx},#{itm.hzxm},#{itm.patid},#{itm.jyje},#{itm.tyje},#{itm.zflsh},#{itm.jyrq},
#{itm.sftkjl},#{itm.zffs},#{itm.jylx},#{itm.czyh},#{itm.trade_date},#{itm.his_wsdl_id}
)
</foreach>
</insert>
<insert id="insertAllHisBillOriginalHY" parameterType="java.util.List">
insert into
hisbill_original_hy(VisitzOrg,BizType,PayType,Amount,ZFAmount,YBZHAmount,YBTCAmount,Receipt_no,PatientID,PatientName,TradeTime,HisTime,HisOperNum,PowerTranID,trade_date)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.visitzOrg},#{itm.bizType},#{itm.payType},#{itm.amount},#{itm.zfAmount},#{itm.ybzhAmount},#{itm.ybtcAmount},
#{itm.receiptNO},#{itm.patientID},#{itm.patientName},#{itm.tradeTime},#{itm.hisTime},#{itm.hisOperNum},#{itm.powerTranID},#{itm.trade_date}
)
</foreach>
</insert>
<!--insert into hisbill_history(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id)
select a.PayMethod,a.TradingStatus,a.BizType,a.PayType,a.TradeTime,a.HisOperCode,a.Amount,a.remarks,a.PlatformTransId,a.PatientId,a.PatientName,a.trade_date,a.his_wsdl_id
from hisbill_original a
where a.trade_date=#{trade_date} 之前的存一份省的又改回来-->
<insert id="insertAllHisBillHistory" parameterType="java.util.List">
insert into
hisbill_history(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.payMethod},#{itm.tradingStatus},#{itm.bizType},#{itm.payType},#{itm.tradeTime},#{itm.hisOperCode},#{itm.amount},#{itm.remarks},#{itm.platformTransId},#{itm.patientId}
,#{itm.patientName},#{itm.trade_date},#{itm.his_wsdl_id}
)
</foreach>
</insert>
<delete id="deleteTempTable">
delete from temp_hisbill_history
</delete>
<insert id="findHisDetailToTemp" parameterType="HashMap">
insert into temp_hisbill_history
select a.PayMethod,a.TradingStatus,a.BizType,a.PayType,a.TradeTime,a.HisOperCode,a.Amount,a.remarks,a.PlatformTransId,a.PatientId,a.PatientName,a.trade_date,a.his_wsdl_id
from hisbill_history a
left join (select PlatformTransId from hisbill_history where TradingStatus='2' and trade_date=#{trade_date}) b
on a.PlatformTransId=b.PlatformTransId
where a.trade_date=#{trade_date} and b.PlatformTransId is null and a.PayType!='5'
</insert>
<select id="findHisDetailByParam" parameterType="HashMap" resultType="HashMap">
select BRNM
,BRID
,ZFJE
,HISDDH
,GHDDH
,ZFFS
,CZY
,JYRQ
,JYSJ
,XTJSH
,ZDH
,JYKH
,ZFZT
from hisbills_history
where trade_date=#{trade_date}
<if test="h_ghddh!=null and h_ghddh!=''">
and H_GHDDH=#{h_ghddh}
</if>
<if test="zfzt!=null and zfzt!=''">
and ZFZT=#{zfzt}
</if>
<if test="orderby_je!=null and orderby_je!=''">
order by ZFJE desc
</if>
</select>
<select id="findHisDetailByTimeAndYSDDH" parameterType="HashMap" resultType="HashMap">
select PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,
PatientId,PatientName
from hisbill_history
where trade_date=#{searchTime}
and PlatformTransId = #{c_ysddh}
</select>
<select id="findHisDetailFirmNumByTime" parameterType="HashMap" resultType="HashMap">
select his_wsdl_id,count(1) as firmNum
from hisbill_history
where TradeTime &gt;= #{startTime}
and TradeTime &lt;= #{endTime}
group by his_wsdl_id
</select>
<select id="findHisCashDetail" parameterType="HashMap" resultType="HashMap">
select PayMethod, TradingStatus, BizType, PayType, TradeTime, HisOperCode, Amount, remarks, PlatformTransId, PatientId, PatientName, trade_date, his_wsdl_id
from hisbill_history
where trade_date=#{trade_date} and PayType='5'
</select>
<select id="findHisDetailCountData" parameterType="HashMap" resultType="HashMap">
select count(1) as num,cast(IFNULL(sum(Amount),0) as decimal(19,2)) as money
from hisbill_history
<where>
<if test="payType!=null and payType!=''">
and PayType = #{payType}
</if>
<if test="startTime!=null and startTime!=''">
and TradeTime &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and TradeTime &lt;= #{endTime}
</if>
<if test="likeFiled!=null and likeFiled!=''">
and PlatformTransId like concat('%',concat(#{likeFiled},'%'))
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,15 @@
<?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.saye.hospitalgd.mapper.HisInterFaceConfigMapper">
<select id="findConfigById" parameterType="java.lang.String" resultType="HashMap">
select id, his_interface_name, his_interface_wsdl, code, partner, sign, operid, password, kfsdm
from his_wsdl_config
where id=#{id}
</select>
<select id="findAllconfig" resultType="HashMap">
select id, his_interface_name, his_interface_wsdl, code, partner, sign, operid, password, kfsdm
from his_wsdl_config
</select>
</mapper>

View File

@@ -0,0 +1,128 @@
<?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.saye.hospitalgd.mapper.HisbillsHistoryMapper">
<insert id="saveHisHistoryData" parameterType="HashMap">
insert into hisbills_history (BRNM,
BRID,
ZFJE,
HISDDH,
GHDDH,
ZFFS,
CZY,
JYRQ,
JYSJ,
XTJSH,
ZDH,
JYKH,
ZFZT)
values (#{name}, #{brid}, #{zfje}, #{hisddh},
#{ghddh}, #{zffs}, #{czy}, #{jyrq}, #{jysj},
#{xtjsh}, #{zdh}, #{jykh}, #{zfzt})
</insert>
<select id="findHisBillsByDate" parameterType="HashMap" resultType="HashMap">
select HisOperCode
, PayMethod
, TradingStatus
, BizType
, PayType
, TradeTime
, Amount
, PlatformTransId
, HisTransId
, PatientID
, PatientName
, source
, trade_date
from hisbills_history
where trade_date = #{trade_date}
</select>
<select id="findHisDetailByParam" parameterType="HashMap" resultType="HashMap">
select HisOperCode
,PayMethod
,TradingStatus
,BizType
,PayType
,TradeTime
,Amount
,PlatformTransId
,HisTransId
,PatientID
,PatientName
,source
,trade_date
from hisbills_history
where trade_date=#{trade_date}
<if test="tranID!=null and tranID!=''">
and HisTransId=#{tranID}
</if>
<if test="h_jylx!=null and h_jylx!=''">
and TradingStatus=#{h_jylx}
</if>
<if test="orderby_je!=null and orderby_je!=''">
order by Amount desc
</if>
</select>
<delete id="deleteOriginalDataByDate" parameterType="HashMap">
delete
from hisbills_original
where trade_date = #{trade_date}
</delete>
<delete id="deleteHistoryDataByDate" parameterType="HashMap">
delete
from hisbills_history
where trade_date = #{trade_date}
</delete>
<insert id="insertHisBillsOriginalList" parameterType="java.util.List">
insert into
hisbills_original(
HisOperCode
,PayMethod
,TradingStatus
,BizType
,PayType
,TradeTime
,Amount
,PlatformTransId
,HisTransId
,PatientID
,PatientName
,source
,trade_date
)
values
<foreach collection="hisBillList" index="index" item="itm" separator=",">
(
#{itm.HisOperCode},#{itm.PayMethod},#{itm.TradingStatus},#{itm.BizType},#{itm.PayType},#{itm.TradeTime},#{itm.Amount},#{itm.PlatformTransId},#{itm.HisTransId},#{itm.patientId},#{itm.PatientName},#{itm.source},#{itm.trade_date}
)
</foreach>
</insert>
<insert id="insertHisbillsHistoryList" parameterType="java.util.List">
insert into
hisbills_history(
HisOperCode
,PayMethod
,TradingStatus
,BizType
,PayType
,TradeTime
,Amount
,PlatformTransId
,HisTransId
,PatientID
,PatientName
,source
,trade_date
)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.HisOperCode},#{itm.PayMethod},#{itm.TradingStatus},#{itm.BizType},#{itm.PayType},#{itm.TradeTime},#{itm.Amount},#{itm.PlatformTransId},#{itm.HisTransId},#{itm.patientId},#{itm.PatientName},#{itm.source},#{itm.trade_date}
)
</foreach>
</insert>
</mapper>

View File

@@ -0,0 +1,48 @@
<?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.saye.hospitalgd.mapper.OperatorMapper">
<select id="findAllOperator" parameterType="HashMap" resultType="HashMap">
select hisoper_id, HisOperCode,user_name,modify_time
from his_operator
<where>
<if test="is_active!=null and is_active!=''">
and is_active=#{is_active}
</if>
<if test="likeFiled!=null and likeFiled!=''">
and (HisOperCode like concat('%',concat(#{likeFiled},'%'))
or user_name like concat('%',concat(#{likeFiled},'%'))
)
</if>
</where>
</select>
<select id="findAllOperatorByCode" parameterType="HashMap" resultType="HashMap">
select hisoper_id, HisOperCode, user_name, modify_time
from his_operator
where HisOperCode = #{hisOperCode}
</select>
<insert id="addOperator" parameterType="HashMap">
insert into his_operator(HisOperCode, user_name, is_active, modify_time)
values (#{hisOperCode}, #{userName}, #{is_active}, #{modify_time})
</insert>
<update id="updateOperatorByCode" parameterType="HashMap">
update his_operator
set
<if test="userName!=null and userName!=''">
user_name=#{userName},
</if>
<if test="hisOperCode!=null and hisOperCode!=''">
HisOperCode=#{hisOperCode},
</if>
<if test="is_active!=null and is_active!=''">
is_active=#{is_active},
</if>
modify_time=#{modify_time}
where hisoper_id=#{hisoperId}
</update>
</mapper>

View File

@@ -0,0 +1,37 @@
<?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.saye.hospitalgd.mapper.ReconciliationResultMapper">
<select id="findReconciliationResultPageList" parameterType="HashMap" resultType="HashMap">
select trade_date,third_money,his_money,difference,third_unilateral,his_unilateral,manager_history_unilateral,today_unilateral,unilateral_num,pending_unilateral,pending_unilateral_num,status,area
,(case status when '1' then '通过' else '不通过' end) as status_str
from reconciliation_result
<where>
<if test="startTime!=null and startTime!=''">
and trade_date &gt;=#{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and trade_date &lt;#{endTime}
</if>
</where>
</select>
<insert id="insertReconciliationResult" parameterType="HashMap">
insert into reconciliation_result(trade_date, third_money, his_money, difference,third_unilateral,his_unilateral, manager_history_unilateral, today_unilateral, unilateral_num, pending_unilateral, pending_unilateral_num, status, area)
VALUES (#{trade_date},#{third_money},#{his_money},#{difference},#{third_unilateral},#{his_unilateral},#{manager_history_unilateral},#{today_unilateral},#{unilateral_num},#{pending_unilateral},#{pending_unilateral_num},#{status},#{area})
ON DUPLICATE KEY UPDATE
third_money=values(third_money),
his_money=values(his_money),
difference=values(difference),
third_unilateral=values(third_unilateral),
his_unilateral=values(his_unilateral),
manager_history_unilateral=values(manager_history_unilateral),
today_unilateral=values(today_unilateral),
unilateral_num=values(unilateral_num),
pending_unilateral=values(pending_unilateral),
pending_unilateral_num=values(pending_unilateral_num),
status=values(status),
area=values(area)
</insert>
</mapper>

View File

@@ -0,0 +1,11 @@
<?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.saye.hospitalgd.mapper.RefundMapper">
<insert id="addRefundInfo" parameterType="HashMap">
insert into refund_table(id, transactionAmount, retrievalRefNum, refundRequestId, refundInvoiceAmount, request_ip, userName, trueName, c_ysddh,bill_table_name)
values (#{id},#{transactionAmount},#{retrievalRefNum},#{refundRequestId},#{refundInvoiceAmount},#{request_ip},#{userName},#{trueName},#{c_ysddh},#{bill_table_name})
</insert>
</mapper>

View File

@@ -0,0 +1,44 @@
<?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.saye.hospitalgd.mapper.RefundOrderMapper">
<select id="findRefundOrder" parameterType="HashMap" resultType="HashMap">
select ID
,PAY_SOURCE
,SERVER_CHANNEL
,SICK_NAME
,CARD_NO
,REFUND_COST_IN
,HOSPITAL_NO
,OLD_PLATFORM_NO
,OLD_CHANNEL_NO
,OPERATOR
,OPERATOR_NAME
,PLATFORM_NO
,PAY_WAY
,REFUND_COST_OUT
,REFUND_STATE
,ORG_CODE
,APP_CODE
,TERMINAL_CODE
,TIME_STAMP
from refundorder_manage
<where>
<if test="startTime!=null and startTime!=''">
and TIME_STAMP &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and TIME_STAMP &lt;= #{endTime}
</if>
<if test="jyly!=null and jyly!=''">
and PAY_SOURCE = #{jyly}
</if>
<if test="likeFiled!=null and likeFiled!=''">
and OLD_PLATFORM_NO like concat('%',concat(#{likeFiled},'%'))
</if>
</where>
order by TIME_STAMP
</select>
</mapper>

View File

@@ -0,0 +1,37 @@
<?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.saye.hospitalgd.mapper.ThirdFtpConfigMapper">
<select id="findThirdFtpConfigList" parameterType="HashMap" resultType="HashMap">
select id,MCH_ID,FTP_HOST,FTP_PORT,FTP_USER,FTP_PASSWORD,FTP_PATH,FTP_FILE_NAME,LOCAL_PATH,bill_table_name,execute_class,is_active
from third_ftp_config
<where>
<if test="is_active!=null and is_active!=''">
and is_active = #{is_active}
</if>
<if test="thirdConfigId!=null and thirdConfigId!=''">
and id=#{thirdConfigId}
</if>
</where>
</select>
<select id="findWLIF" parameterType="HashMap" resultType="HashMap">
select
CUST_ID
,USER_ID
,TX_CODE
,PASSWORD
,LANGUAGE
,WLIP
,WLPORT
,FILEPATH
,FUBS
,EXECUTE_CLASS from wlif
<where>
<if test="FUBS!=null and FUBS!=''">
and FUBS=#{FUBS}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,40 @@
<?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.saye.hospitalgd.mapper.ThirdSftpConfigMapper">
<!--<select id="findThirdSftpConfigList"-->
<select id="findThirdSftpConfigList" parameterType="HashMap" resultType="HashMap">
select
id,MCH_ID,SFTP_HOST,SFTP_PORT,SFTP_USER,PRIKEYBASE_PATH,SFTP_PATH,SFTP_FILE_NAME,LOCAL_PATH,bill_table_name,execute_class,is_active
from third_sftp_config
<where>
<if test="is_active!=null and is_active!=''">
and is_active = #{is_active}
</if>
<if test="thirdConfigId!=null and thirdConfigId!=''">
and id=#{thirdConfigId}
</if>
</where>
</select>
<select id="findWLIF" parameterType="HashMap" resultType="HashMap">
select
CUST_ID
,USER_ID
,TX_CODE
,PASSWORD
,LANGUAGE
,WLIP
,WLPORT
,FILEPATH
,FUBS
,EXECUTE_CLASS from wlif
<where>
<if test="FUBS!=null and FUBS!=''">
and FUBS=#{FUBS}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,542 @@
<?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.saye.hospitalgd.mapper.TransactionDetailMapper">
<!--查询his和三方关联的账单-->
<select id="findHisAndThirdJoinData" parameterType="HashMap" resultType="HashMap">
select JYSJ
,I_DDH
,I_JYJE
,I_JYLX
,I_JYQD
,TradeTime
,TranID
,BizType
,H_JYLX
,Amount
,PayType
,HisOperNum
,PatientID
,PatientName
,sort_date
,trade_date
,err_type
,check_result
from third_join_his
<where>
<if test="operCode!=null and operCode!=''">
and HisOperNum=#{operCode}
</if>
<if test="BizType!=null and BizType!=''">
and BizType=#{BizType}
</if>
<if test="payType!=null and payType!=''">
and PayType=#{payType}
</if>
<if test="thirdPay!=null and thirdPay!=''">
and I_JYQD=#{thirdPay}
</if>
<if test="startTime!=null and startTime!=''">
and trade_date &gt;=#{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and trade_date &lt;=#{endTime}
</if>
<if test="check_result!=null and check_result!=''">
and check_result =#{check_result}
</if>
<if test="is_active!=null and is_active!=''">
and is_active =#{is_active}
</if>
</where>
order by trade_date, sort_date desc
</select>
<select id="findHisUnilateral" resultType="HashMap">
select a.PlatformTransId, a.trade_date, a.TradeTime, a.PayType, a.Amount
from temp_hisbill_history a
left join temp_bankbill_history b on a.PlatformTransId = b.C_YSDDH
where b.C_YSDDH is null
</select>
<select id="findBankUnilateral" resultType="HashMap">
select a.C_YSDDH, a.C_JYRQ as trade_date, concat(a.C_JYRQ, ' ', a.C_JYSJ) as TradeTime, a.c_zffs, a.C_JYJE
from temp_bankbill_history a
left join temp_hisbill_history b on a.C_YSDDH = b.PlatformTransId
where b.PlatformTransId is null
</select>
<select id="findDiff" resultType="HashMap">
select a.PlatformTransId, a.Amount, b.C_JYJE, a.PayType, b.C_ZFFS, a.trade_date, a.TradeTime
from temp_hisbill_history a
left join temp_bankbill_history b on a.PlatformTransId = b.C_YSDDH
where a.Amount != b.C_JYJE
</select>
<select id="findHisAndThirdJoinDataNumByTime" parameterType="HashMap" resultType="HashMap">
select b.C_ZFFS, b.C_JYRQ, count(1) as totalNum
from hisbill_history a
inner join bankbill_history b on a.PlatformTransId = b.C_YSDDH
where b.C_JYRQ &gt;= #{startTime}
and b.C_JYRQ &lt;= #{endTime}
group by b.C_ZFFS, b.C_JYRQ
</select>
<insert id="insertJoinDataToHisAndThird" parameterType="HashMap">
insert into third_join_his( JYSJ, I_DDH, I_JYJE, I_JYLX, I_JYQD, TradeTime, TranID, BizType, H_JYLX, Amount
, PayType
, HisOperNum, PatientID, PatientName
, sort_date, trade_date, err_type, check_result, is_active)
select concat(b.I_JYRQ, ' ', b.I_JYSJ) as jysj
, b.I_DDH
, b.I_JYJE
, b.I_JYLX
, b.I_FXK
, b.I_JYSJ
, a.PlatformTransId
, a.BizType
, a.TradingStatus
, a.Amount
, a.PayType
, a.HisOperCode
, a.PatientID
, a.PatientName
, a.TradeTime
, a.trade_date
, ''
, '0'
, '1'
from (select * from hisbills_history where trade_date = #{trade_date}) a
inner join
(select * from bankbills_history where I_JYRQ = #{trade_date}) b
on a.PlatformTransId = b.I_DDH and a.TradingStatus = b.I_JYLX and a.Amount+0 = b.I_JYJE+0
</insert>
<insert id="insertHisUnilateral" parameterType="HashMap">
insert into third_join_his( JYSJ, I_DDH, I_JYJE, I_JYLX, I_JYQD, TradeTime, TranID, BizType, H_JYLX, Amount
, PayType
, HisOperNum, PatientID, PatientName
, sort_date, trade_date, err_type, check_result, is_active)
select a.TradeTime as jysj
, b.I_DDH
, b.I_JYJE
, b.I_JYLX
, b.I_FXK
, b.I_JYSJ
, a.PlatformTransId
, a.BizType
, a.TradingStatus
, a.Amount
, a.PayType
, a.HisOperCode
, a.PatientID
, a.PatientName
, a.TradeTime
, a.trade_date
, '1'
, '1'
, '1'
from (select * from hisbills_history where trade_date = #{trade_date}) a
left join
(select * from bankbills_history where I_JYRQ = #{trade_date}) b
on a.PlatformTransId = b.I_DDH and a.TradingStatus = b.I_JYLX and a.Amount+0 = b.I_JYJE+0
where b.I_DDH is null
</insert>
<insert id="insertThirdUnilateral" parameterType="HashMap">
insert into third_join_his( JYSJ, I_DDH, I_JYJE, I_JYLX, I_JYQD, TradeTime, TranID, BizType, H_JYLX, Amount
, PayType
, HisOperNum, PatientID, PatientName
, sort_date, trade_date, err_type, check_result, is_active)
select concat(b.I_JYRQ, ' ', b.I_JYSJ) as jysj
, b.I_DDH
, b.I_JYJE
, b.I_JYLX
, b.I_FXK
, b.I_JYSJ
, a.HisTransId
, a.BizType
, a.TradingStatus
, a.Amount
, a.PayType
, a.HisOperCode
, a.PatientID
, a.PatientName
, b.I_JYSJ
, b.I_JYRQ
, '2'
, '1'
, '1'
from (select * from hisbills_history where trade_date = #{trade_date}) a
right join
(select * from bankbills_history where I_JYRQ = #{trade_date}) b
on a.PlatformTransId = b.I_DDH and a.TradingStatus = b.I_JYLX and a.Amount + 0 = b.I_JYJE + 0
where a.PlatformTransId is null
</insert>
<insert id="insertJoinDataToHisAndCash" parameterType="HashMap">
insert into third_join_his(jysj, c_ysddh, c_jyje, c_zffs, c_jylx, czyh, paymethod, tradingstatus, biztype,
paytype, tradetime, hisopercode, amount, platformtransid, patientid, patientname,
sort_date, trade_date, err_type, check_result, is_active)
select b.trade_date
, ''
, b.jyje
, #{cash_code}
, ''
, b.czyh
, a.PayMethod
, a.TradingStatus
, a.BizType
, a.PayType
, a.TradeTime
, a.HisOperCode
, a.Amount
, a.PlatformTransId
, a.patientid
, a.patientname
, b.trade_date
, b.trade_date
, ''
, '0'
, '1'
from (select * from hisbill_history where trade_date = #{trade_date} and payType = #{cash_code}) a
inner join
(select * from cash_record where trade_date = #{trade_date}) b
on a.HisOperCode = b.czyh
</insert>
<insert id="insertHisCashUnilateral" parameterType="HashMap">
insert into third_join_his(jysj, c_ysddh, c_jyje, c_zffs, c_jylx, czyh, paymethod, tradingstatus, biztype,
paytype, tradetime, hisopercode, amount, platformtransid, patientid, patientname,
sort_date, trade_date, err_type, check_result, is_active)
select b.trade_date
, ''
, b.jyje
, #{cash_code}
, ''
, b.czyh
, a.PayMethod
, a.TradingStatus
, a.BizType
, a.PayType
, a.TradeTime
, a.HisOperCode
, a.Amount
, a.PlatformTransId
, a.patientid
, a.patientname
, a.trade_date
, a.trade_date
, '1'
, '1'
, '1'
from (select * from hisbill_history where trade_date = #{trade_date} and payType = #{cash_code}) a
left join
(select * from cash_record where trade_date = #{trade_date}) b
on a.HisOperCode = b.czyh
where b.czyh is null
</insert>
<insert id="insertCashUnilateral" parameterType="HashMap">
insert into third_join_his(jysj, c_ysddh, c_jyje, c_zffs, c_jylx, czyh, paymethod, tradingstatus, biztype,
paytype, tradetime, hisopercode, amount, platformtransid, patientid, patientname,
sort_date, trade_date, err_type, check_result, is_active)
select b.trade_date
, ''
, b.jyje
, #{cash_code}
, ''
, b.czyh
, a.PayMethod
, a.TradingStatus
, a.BizType
, a.PayType
, a.TradeTime
, a.HisOperCode
, a.Amount
, a.PlatformTransId
, a.patientid
, a.patientname
, b.trade_date
, b.trade_date
, '2'
, '1'
, '1'
from (select * from hisbill_history where trade_date = #{trade_date} and payType = #{cash_code}) a
right join
(select * from cash_record where trade_date = #{trade_date}) b
on a.HisOperCode = b.czyh
where a.HisOperCode is null
</insert>
<update id="updateHisAndThirdError" parameterType="HashMap">
update third_join_his
set err_type='3',
check_result='1'
where trade_date = #{trade_date}
and check_result = '0'
and (I_JYJE + 0) != (Amount + 0)
</update>
<delete id="deleteHisAndThirdJoinData" parameterType="HashMap">
delete
from third_join_his
where trade_date = #{trade_date}
</delete>
<select id="findHisAndThirdJoinDataByParam" parameterType="HashMap" resultType="HashMap">
select JYSJ
,I_DDH
,I_JYJE
,I_JYLX
,I_JYQD
,TradeTime
,TranID
,BizType
,H_JYLX
,Amount
,PayType
,HisOperNum
,PatientID
,PatientName
,sort_date
,trade_date
,err_type
,check_result
,is_active
from third_join_his
<where>
<if test="trade_date!=null and trade_date!=''">
and trade_date=#{trade_date}
</if>
<if test="BizType!=null and BizType!=''">
and BizType=#{BizType}
</if>
<if test="check_result!=null and check_result!=''">
and check_result=#{check_result}
</if>
<if test="err_type!=null and err_type!=''">
and err_type=#{err_type}
</if>
<if test="i_ddh!=null and i_ddh!=''">
and I_DDH=#{i_ddh}
</if>
<if test="i_jylx!=null and i_jylx!=''">
and I_JYLX=#{i_jylx}
</if>
<if test="tranid!=null and tranid!=''">
and TranID=#{tranid}
</if>
<if test="h_jylx!=null and h_jylx!=''">
and H_JYLX=#{h_jylx}
</if>
</where>
</select>
<insert id="insertHisAndThirdJoinData" parameterType="HashMap">
insert into third_join_his(jysj, c_ysddh, c_jyje, c_zffs, c_jylx, paymethod, tradingstatus, biztype, paytype,
tradetime, hisopercode, amount, platformtransid, patientid, patientname, sort_date,
trade_date, err_type, check_result)
values (#{jysj}, #{c_ysddh}, #{c_jyje}, #{c_zffs}, #{c_jylx}, #{paymethod}, #{tradingstatus}, #{biztype},
#{paytype}, #{tradetime}, #{hisopercode}, #{amount}, #{platformtransid}, #{patientid}, #{patientname},
#{sort_date}, #{trade_date}, #{err_type}, #{check_result})
</insert>
<update id="updateJoinDate" parameterType="HashMap">
update third_join_his set check_result=#{check_result}
<where>
<if test="tranID!=null and tranID!=''">
and TranID=#{tranID}
</if>
<if test="h_jylx!=null and h_jylx!=''">
and H_JYLX=#{h_jylx}
</if>
<if test="i_ddh!=null and i_ddh!=''">
and I_DDH=#{i_ddh}
</if>
<if test="i_jylx!=null and i_jylx!=''">
and I_JYLX=#{i_jylx}
</if>
</where>
</update>
<update id="updateJoinSetActiveByThird" parameterType="HashMap">
update third_join_his
set is_active=#{is_active}
where I_DDH = #{i_ddh}
and I_JYLX = #{i_jylx}
</update>
<update id="updateJoinSetActiveByHis" parameterType="HashMap">
update third_join_his
set is_active=#{is_active}
where TranID = #{tranID}
and H_JYLX = #{h_jylx}
</update>
<update id="updateJoinSetActiveByThirdCash" parameterType="HashMap">
update third_join_his
set is_active=#{is_active}
where czyh = #{hisOperCode}
and trade_date = #{trade_date}
and C_ZFFS = #{c_zffs}
</update>
<update id="updateJoinSetActiveByHisCash" parameterType="HashMap">
update third_join_his
set is_active=#{is_active}
where HisOperCode = #{hisOperCode}
and trade_date = #{trade_date}
and PayType = #{payType}
and payMethod = #{payMethod}
</update>
<update id="updateJoinSetActiveByZhiPiao" parameterType="HashMap">
update third_join_his
set is_active=#{is_active}
where HisOperCode = #{hisOperCode}
and trade_date = #{trade_date}
and PayType = #{payType}
and payMethod = #{payMethod}
</update>
<select id="findAllBankDetailNum" parameterType="HashMap" resultType="HashMap">
select count(1) as num
from third_join_his
where trade_date &gt;= #{startTime}
and trade_date &lt;= #{endTime}
and is_active = '1'
and I_JYJE is not null
</select>
<select id="findAllBankDetailSum" parameterType="HashMap" resultType="HashMap">
select IFNULL(sum(I_JYJE), 0) as Money
from third_join_his
where trade_date &gt;= #{startTime}
and trade_date &lt;= #{endTime}
and is_active = '1'
and I_JYJE is not null
</select>
<select id="findDBZNum" parameterType="HashMap" resultType="HashMap">
SELECT trade_date, count(1) as num
FROM third_join_his
where trade_date &gt;= #{startTime}
and trade_date &lt;= #{endTime}
and check_result = '1'
and is_active = '1'
group by trade_date
</select>
<select id="findJoinDataNumByTime" parameterType="HashMap" resultType="HashMap">
select aI_ZFFS as I_ZFFS, trade_date, totalNum
from (select (case when I_JYQD is null then PayType else I_JYQD end) as aI_ZFFS,
trade_date,
count(1) as totalNum
from third_join_his
where trade_date &gt;= #{startTime}
and trade_date &lt;= #{endTime}
and is_active = '1'
group by aI_ZFFS, trade_date) t
</select>
<select id="findDBZFLNumByTime" parameterType="HashMap" resultType="HashMap">
select aI_ZFFS as I_ZFFS, trade_date, num
from (SELECT (case when I_JYQD is null then PayType else I_JYQD end) as aI_ZFFS, trade_date, count(1) as num
FROM third_join_his
where trade_date &gt;= #{startTime}
and trade_date &lt;= #{endTime}
and is_active = '1'
and check_result = '1'
group by aI_ZFFS, trade_date) t
</select>
<select id="findBankBillNumByTime" parameterType="HashMap" resultType="HashMap">
select trade_date, I_JYQD, count(1) as num
from third_join_his
where trade_date &gt;= #{startTime}
and trade_date &lt;= #{endTime}
and I_JYLX = '1'
and is_active = '1'
and I_JYJE is not null
group by I_JYQD, trade_date
order by I_JYQD, trade_date
</select>
<select id="findBankBillMoneyByTime" parameterType="HashMap" resultType="HashMap">
select trade_date, I_JYQD, sum(cast(I_JYJE as decimal(18, 2))) as money
from third_join_his
where trade_date &gt;= #{startTime}
and trade_date &lt;= #{endTime}
and is_active = '1'
and I_JYJE is not null
group by I_JYQD, trade_date
order by I_JYQD, trade_date
</select>
<!--查询关联表中不唯一的记录-->
<!-- <select id="findHisAndThirdJoinDataByParamAndNotUnique" parameterType="HashMap" resultType="HashMap">
select jysj, c_ysddh, c_jyje, c_zffs, c_jylx, paymethod, tradingstatus, biztype, paytype, tradetime, hisopercode, amount, platformtransid, patientid, patientname, sort_date, trade_date, err_type, check_result ,join_id
from third_join_his a where trade_date=#{trade_date}
and EXISTS( select 1 from (
select PlatformTransId,TradingStatus from third_join_his where trade_date=#{trade_date} and PlatformTransId!='' group by PlatformTransId,TradingStatus having count(PlatformTransId)>1
) b where a.PlatformTransId=b.PlatformTransId and a.TradingStatus=b.TradingStatus )
order by PlatformTransId
</select>-->
<select id="findHisAndThirdJoinDataByParamAndNotUnique" parameterType="HashMap" resultType="HashMap">
select TranID, H_JYLX,Amount
from third_join_his
where trade_date = #{trade_date}
and TranID != ''
group by TranID, H_JYLX,Amount
having count(TranID) > 1
</select>
<!--删除所有重复记录-->
<delete id="deleteHisAndThirdJoinDataByParamAndNotUnique" parameterType="HashMap">
delete
from third_join_his
where trade_date = #{trade_date}
and TranID = #{tranID}
and H_JYLX = #{h_jylx}
</delete>
<!--添加修改后的重复记录回数据库-->
<insert id="addNotUniqueData" parameterType="java.util.List">
insert into third_join_his(JYSJ
,I_DDH
,I_JYJE
,I_JYLX
,I_JYQD
,TradeTime
,TranID
,BizType
,H_JYLX
,Amount
,PayType
,HisOperNum
,PatientID
,PatientName
,sort_date
,trade_date
,err_type
,check_result
,is_active
,join_id
)
values
<foreach collection="list" index="index" item="itm" separator=",">
(
#{itm.jysj}, #{itm.i_ddh}, #{itm.i_jyje}, #{itm.i_jylx}, #{itm.i_jyqd},
#{itm.tradeTime}, #{itm.tranID}, #{itm.BizType}, #{itm.h_jylx}, #{itm.amount}, #{itm.payType},
#{itm.hisOperNum},
#{itm.patientid}, #{itm.patientname}, #{itm.sort_date},
#{itm.trade_date}, #{itm.err_type}, #{itm.check_result}, #{itm.is_active}, #{itm.join_id}
)
</foreach>
</insert>
</mapper>

View File

@@ -0,0 +1,149 @@
<?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.saye.hospitalgd.mapper.TranscationsMapper">
<select id="findTradeRecords" parameterType="HashMap" resultType="HashMap">
select ID
,PAY_SOURCE
,SERVER_CHANNEL
,PATIENT_ID
,PAY_CHANNEL
,SICK_NAME
,MOBILE_PHONE
,CARD_NO
,ID_NO
,VISIT_NO
,COST
,HOSPITAL_NO
,AGGREGATED_PAY_FLAG
,AUTH_CODE
,OPERATOR
,OPERATOR_NAME
,ORDER_STATE
,PLATFORM_NO
,THRIDPLATFORM_NO
,PAY_WAY
,PAYSTATUS_INFO
,REFUND_COST
,CAN_REFUND_COST
,REFUND_STATE
,ORG_CODE
,APP_CODE
,TERMINAL_CODE
,TIME_STAMP
,OTHER_INFO
from payorder_manage
<where>
<if test="startTime!=null and startTime!=''">
and TIME_STAMP &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and TIME_STAMP &lt;= #{endTime}
</if>
<if test="jyly!=null and jyly!=''">
and PAY_SOURCE = #{jyly}
</if>
<if test="likeFiled!=null and likeFiled!=''">
and PLATFORM_NO like concat('%',concat(#{likeFiled},'%'))
</if>
</where>
order by TIME_STAMP
</select>
<select id="findActionableTrading" parameterType="HashMap" resultType="HashMap">
select ID
,PAY_SOURCE
,SERVER_CHANNEL
,PATIENT_ID
,PAY_CHANNEL
,SICK_NAME
,MOBILE_PHONE
,CARD_NO
,ID_NO
,VISIT_NO
,COST
,HOSPITAL_NO
,AGGREGATED_PAY_FLAG
,AUTH_CODE
,OPERATOR
,OPERATOR_NAME
,ORDER_STATE
,PLATFORM_NO
,THRIDPLATFORM_NO
,PAY_WAY
,PAYSTATUS_INFO
,REFUND_COST
,CAN_REFUND_COST
,REFUND_STATE
,ORG_CODE
,APP_CODE
,TERMINAL_CODE
,TIME_STAMP
,OTHER_INFO
from payorder_manage
<where>
CAN_REFUND_COST > 0
<if test="startTime!=null and startTime!=''">
and TIME_STAMP &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and TIME_STAMP &lt;= #{endTime}
</if>
<if test="jyly!=null and jyly!=''">
and PAY_SOURCE = #{jyly}
</if>
<if test="jylsh!=null and jylsh!=''">
and PLATFORM_NO = #{jylsh}
</if>
<if test="likeFiled!=null and likeFiled!=''">
and PLATFORM_NO like concat('%',concat(#{likeFiled},'%'))
</if>
</where>
order by TIME_STAMP
</select>
<select id="findActionableTradingByJylsh" parameterType="HashMap" resultType="HashMap">
select ID
,PAY_SOURCE
,SERVER_CHANNEL
,PATIENT_ID
,PAY_CHANNEL
,SICK_NAME
,MOBILE_PHONE
,CARD_NO
,ID_NO
,VISIT_NO
,COST
,HOSPITAL_NO
,AGGREGATED_PAY_FLAG
,AUTH_CODE
,OPERATOR
,OPERATOR_NAME
,ORDER_STATE
,PLATFORM_NO
,THRIDPLATFORM_NO
,PAY_WAY
,PAYSTATUS_INFO
,REFUND_COST
,CAN_REFUND_COST
,REFUND_STATE
,ORG_CODE
,APP_CODE
,TERMINAL_CODE
,TIME_STAMP
,OTHER_INFO
from payorder_manage
<where>
CAN_REFUND_COST > 0
<if test="jylsh!=null and jylsh!=''">
and PLATFORM_NO = #{jylsh}
</if>
</where>
order by TIME_STAMP
</select>
</mapper>

View File

@@ -0,0 +1,220 @@
<?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.saye.hospitalgd.mapper.UnilateralMapper">
<select id="findAllUnilateral" parameterType="HashMap" resultType="HashMap">
select id
,PayType
,TranID
,H_JYLX
,trade_date
,HisOperNum
,Amount
,I_JYJE
,I_JYLX
,I_DDH
,I_JYQD
,TradeTime
,is_manager
,manager_time
,err_type
,remark
,create_time
,modify_time
,managerType
from unmanger_unilateral
<where>
<if test="startTime!=null and startTime!=''">
and trade_date &gt;=#{startTime}
</if>
<if test="startTime!=null and startTime!=''">
and trade_date &lt;=#{endTime}
</if>
<if test="payType!=null and payType!=''">
and payType =#{payType}
</if>
<if test="thirdPay!=null and thirdPay!=''">
and I_JYQD =#{thirdPay}
</if>
<if test="err_type!=null and err_type!=''">
and err_type =#{err_type}
</if>
<if test="is_manager!=null and is_manager!=''">
and is_manager=#{is_manager}
</if>
</where>
order by trade_date
</select>
<insert id="insertUnilateral" parameterType="HashMap">
insert into unmanger_unilateral( id
, PayType
, TranID
, H_JYLX
, trade_date
, HisOperNum
, Amount
, I_JYJE
, I_JYLX
, I_DDH
, I_JYQD
, TradeTime
, is_manager
, manager_time
, err_type
, remark
, create_time
, modify_time
, join_id)
values (#{id}, #{payType}, #{tranID}, #{h_jylx}, #{trade_date}, #{hisOperNum},
#{amount}, #{i_jyje}, #{i_jylx}, #{i_ddh}, #{i_jyqd}, #{trade_time}, #{is_manager},
#{manager_time}, #{err_type}, #{remark}, #{create_time}, #{modify_time}, #{join_id})
</insert>
<update id="updateUnilateral" parameterType="HashMap">
update unmanger_unilateral
set
<if test="is_manager!=null and is_manager!=''">
is_manager=#{is_manager},
</if>
<if test="manager_time!=null and manager_time!=''">
manager_time=#{manager_time},
</if>
<if test="remark!=null and remark!=''">
remark=#{remark},
</if>
<if test="i_jyje!=null and i_jyje!=''">
I_JYJE=#{i_jyje},
</if>
<if test="amount!=null and amount!=''">
Amount=#{amount},
</if>
<if test="err_type!=null and err_type!=''">
err_type=#{err_type},
</if>
modify_time=#{modify_time}
where 1=1
<if test="tranID!=null and tranID!=''">
and TranID=#{tranID}
</if>
<if test="h_jylx!=null and h_jylx!=''">
and H_JYLX=#{h_jylx}
</if>
<if test="i_jylx!=null and i_jylx!=''">
and I_JYLX=#{i_jylx}
</if>
<if test="i_ddh!=null and i_ddh!=''">
and I_DDH=#{i_ddh}
</if>
</update>
<!--按天查询单边账数量-->
<select id="findDBZNum" parameterType="HashMap" resultType="HashMap">
SELECT trade_date, count(1) as num
FROM unmanger_unilateral
where trade_date &gt;= #{startTime}
and trade_date &lt;= #{endTime}
group by trade_date
</select>
<!--按支付方式和天查询单边账数量-->
<select id="findDBZFLNumByTime" parameterType="HashMap" resultType="HashMap">
SELECT (case when C_ZFFS = '' or c_zffs is null then payType else C_ZFFS end) as payType,
trade_date,
count(1) as num
FROM unmanger_unilateral
where trade_date &gt;= #{startTime}
and trade_date &lt;= #{endTime}
group by payType, trade_date
</select>
<delete id="deleteUnilateral" parameterType="HashMap">
delete
from unmanger_unilateral
where trade_date = #{trade_date}
</delete>
<select id="findUnilateralByParam" parameterType="HashMap" resultType="HashMap">
select id
,PayType
,TranID
,H_JYLX
,trade_date
,HisOperNum
,Amount
,I_JYJE
,I_JYLX
,I_DDH
,I_JYQD
,TradeTime
,is_manager
,manager_time
,err_type
,remark
,create_time
,modify_time
,managerType
from unmanger_unilateral
where trade_date=#{trade_date}
<if test="hisopernum!=null and hisopernum!=''">
and HisOperNum=#{hisopernum}
</if>
<if test="h_jylx!=null and h_jylx!=''">
and H_JYLX =#{h_jylx}
</if>
<if test="i_ddh!=null and i_ddh!=''">
and I_DDH=#{i_ddh}
</if>
<!-- <if test="payMethod!=null and payMethod!=''">-->
<!-- and payMethod=#{payMethod}-->
<!-- </if>-->
<if test="payType!=null and payType!=''">
and PayType=#{payType}
</if>
<if test="tranid!=null and tranid!=''">
and TranID=#{tranid}
</if>
<if test="i_jyqd!=null and i_jyqd!=''">
and I_JYQD=#{i_jyqd}
</if>
<if test="i_jylx!=null and i_jylx!=''">
and I_JYLX=#{i_jylx}
</if>
<if test="join_id!=null and join_id!=''">
and join_id=#{join_id}
</if>
</select>
<delete id="deleteUnilateralByNoManager" parameterType="HashMap">
delete
from unmanger_unilateral
where trade_date = #{trade_date}
and is_manager = '0'
</delete>
<update id="updateUnilateralManagerStatus" parameterType="HashMap">
update unmanger_unilateral
set managerType=#{managerType},
is_manager='1',
remark=#{remark},
manager_time=#{manager_time}
where id = #{id}
</update>
<delete id="deleteUnilateralByJoinIdNotNull" parameterType="HashMap">
delete
from unmanger_unilateral
where trade_date = #{trade_date}
and join_id is not null
and join_id != ''
</delete>
<delete id="deleteUnilateralByIdandStatus" parameterType="HashMap">
delete
from unmanger_unilateral
where trade_date = #{trade_date}
and TranID = #{tranID}
and H_JYLX = #{h_jylx}
</delete>
</mapper>

View File

@@ -0,0 +1,23 @@
<?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.saye.hospitalgd.mapper.hisbillsOriginalMapper">
<insert id="saveHisOriginalData" parameterType="HashMap">
insert into hisbills_original (BRNM,
BRID,
ZFJE,
HISDDH,
GHDDH,
ZFFS,
CZY,
JYRQ,
JYSJ,
XTJSH,
ZDH,
JYKH,
ZFZT)
values (#{name}, #{brid}, #{zfje}, #{hisddh},
#{ghddh}, #{zffs}, #{czy}, #{jyrq}, #{jysj},
#{xtjsh}, #{zdh}, #{jykh}, #{zfzt})
</insert>
</mapper>

View File

@@ -0,0 +1,39 @@
<?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.saye.hospitalgd.mapper.historyLog.CashDetailMapper">
<select id="findCashDetailPageList" parameterType="HashMap" resultType="HashMap">
select czyh, trade_date, jyje, sjlx
from cash_record
<where>
<if test="startTime!=null and startTime!=''">
and trade_date &gt;=#{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and trade_date &lt;=#{endTime}
</if>
</where>
order by trade_date desc
</select>
<insert id="insertCash" parameterType="java.util.List">
insert into cash_record(czyh, trade_date, jyje ,create_time)
values
<foreach collection="list" index="index" item="itm" separator="," >
(#{itm.czyh},#{itm.trade_date},#{itm.jyje},#{itm.create_time})
</foreach>
</insert>
<update id="editCash" parameterType="HashMap">
update cash_record set jyje=#{jyje} where czyh=#{czyh} and trade_date=#{trade_date}
</update>
<delete id="deleteCash" parameterType="HashMap">
delete from cash_record where czyh=#{czyh} and trade_date=#{trade_date}
</delete>
<select id="findCashDetailList" parameterType="HashMap" resultType="HashMap">
select czyh, trade_date, jyje, sjlx
from cash_record where trade_date=#{trade_date}
</select>
</mapper>

View File

@@ -0,0 +1,44 @@
<?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.saye.hospitalgd.mapper.historyLog.HisBillLogMapper">
<!--查询his记录下载情况-->
<select id="findHisBillLogPageList" parameterType="HashMap" resultType="HashMap">
select trade_date,quartz_id,quartz_name,is_ok,modify_time,his_wsdl_id from hisbill_getinfo
<where>
<if test="startTime!=null and startTime!=''">
and trade_date &gt;=#{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and trade_date &lt;=#{endTime}
</if>
<if test="is_ok!=null and is_ok!=''">
and is_ok=#{is_ok}
</if>
<if test="his_wsdl_id!=null and his_wsdl_id!=''">
and his_wsdl_id=#{his_wsdl_id}
</if>
</where>
order by trade_date desc
</select>
<insert id="insertHisbillGetinfo" parameterType="HashMap">
insert into hisbill_getinfo(trade_date,quartz_id,quartz_name,is_ok,modify_time,his_wsdl_id)
values (#{trade_date},#{quartz_id},#{quartz_name},#{is_ok},#{modify_time},#{his_wsdl_id})
ON DUPLICATE KEY UPDATE
quartz_id=values(quartz_id),
quartz_name=values(quartz_name),
is_ok=values(is_ok),
modify_time=values(modify_time),
his_wsdl_id=values(his_wsdl_id)
</insert>
<select id="findHisBillLogByParam" parameterType="HashMap" resultType="HashMap">
select trade_date,quartz_id,quartz_name,is_ok,modify_time from hisbill_getinfo
where trade_date=#{trade_date}
<if test="is_ok!=null and is_ok!=''">
and is_ok=#{is_ok}
</if>
</select>
</mapper>

View File

@@ -0,0 +1,47 @@
<?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.saye.hospitalgd.mapper.historyLog.ReconciliationLogMapper">
<select id="findReconciliationLogPageList" parameterType="HashMap" resultType="HashMap">
select trade_date,modify_time,create_time,manager_num,status,user_name,remark
from reconciliation_info
<where>
<if test="startTime!=null and startTime!=''">
and trade_date &gt;=#{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and trade_date &lt;=#{endTime}
</if>
<if test="status!=null and status!=''">
and status=#{status}
</if>
</where>
order by trade_date desc
</select>
<select id="findReconciliationLogByParam" parameterType="HashMap" resultType="HashMap">
select trade_date,
modify_time,
create_time,
manager_num,
status,
user_name,
remark,
quartz_id,
quartz_name
from reconciliation_info
where trade_date = #{trade_date}
</select>
<insert id="insertReconciliationLog" parameterType="HashMap">
insert into reconciliation_info(trade_date, modify_time, create_time, manager_num,
status, user_name, quartz_id, quartz_name)
values (#{trade_date}, #{modify_time}, #{create_time}, #{manager_num},
#{status}, #{user_name}, #{quartz_id}, #{quartz_name})
ON DUPLICATE KEY UPDATE modify_time=values(modify_time),
user_name=values(user_name),
status=values(status),
manager_num=values(manager_num)
</insert>
</mapper>

View File

@@ -0,0 +1,163 @@
<?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.saye.hospitalgd.mapper.system.DepartMapper">
<resultMap id="BaseResultMap" type="com.saye.hospitalgd.model.Departs">
<id column="depart_id" property="departId" jdbcType="VARCHAR"/>
<result column="depart_name" property="departName" jdbcType="VARCHAR"/>
<result column="parent_id" property="parentId" jdbcType="VARCHAR"/>
<result column="leaf" property="leaf" jdbcType="VARCHAR"/>
<result column="isactive" property="isactive" jdbcType="VARCHAR"/>
<result column="modify_user_name" property="modifyUserName" jdbcType="VARCHAR"/>
<result column="modify_true_name" property="modifyTrueName" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="VARCHAR"/>
<result column="create_date" property="createDate" jdbcType="VARCHAR"/>
<result column="modify_time" property="modifyTime" jdbcType="VARCHAR"/>
</resultMap>
<select id="findDepartTreeNodeList" resultMap="BaseResultMap">
select d.depart_id,
d.depart_name,
d.parent_id,
case d.leaf when '0' then 'true' else 'false' end as leaf,
d.modify_user_name,
d.create_time
from departs d
where d.isactive = '1'
and d.parent_id = #{parentId}
</select>
<select id="selectDepartTreeList" resultMap="BaseResultMap">
select d.depart_id,
d.depart_name,
d.parent_id,
case d.leaf when '0' then 'true' else 'false' end as leaf,
d.modify_user_name,
d.create_time
from departs d
where d.isactive = '1'
</select>
<select id="selectAllDeparts" resultType="HashMap">
select d.depart_id,
d.depart_name,
d.parent_id,
d2.DEPART_NAME as parent_name,
case d.leaf when '0' then 'true' else 'false' end as leaf,
d.modify_user_name,
d.create_time
from departs d
left join departs d2 on d.parent_id = d2.DEPART_ID
where d.isactive = '1'
</select>
<select id="selectDepartTreeListByParentId" resultType="HashMap">
select d.depart_id,
d.depart_name,
d.parent_id,
d.isactive,
d.modify_user_name,
d.modify_true_name,
d.create_time,
d.create_date,
d.modify_time
from departs d
where d.isactive = '1'
order by d.DEPART_ID
</select>
<insert id="addDepart">
insert into departs(DEPART_ID, DEPART_NAME, PARENT_ID, LEAF,
ISACTIVE, MODIFY_USER_NAME, MODIFY_TRUE_NAME, CREATE_TIME, CREATE_DATE, modify_time)
values (#{departId}, #{departName}, #{parentId}, '1', '1', #{modifyUserName}, #{modifyTrueName}, #{createTime},
#{createDate}, #{modifyTime})
</insert>
<update id="modifyDepart">
UPDATE departs
<set>
<if test="departName!=null and departName!=''">
depart_name = #{departName},
</if>
<if test="modifyUserName!=null and modifyUserName!=''">
MODIFY_USER_NAME = #{modifyUserName},
</if>
<if test="modifyTrueName!=null and modifyTrueName!=''">
MODIFY_TRUE_NAME = #{modifyTrueName},
</if>
<if test="createTime!=null and createTime!=''">
CREATE_TIME =#{createTime},
</if>
<if test="createDate!=null and createDate!=''">
CREATE_DATE =#{createDate},
</if>
<if test="modifyTime!=null and modifyTime!=''">
modify_time =#{modifyTime},
</if>
</set>
where depart_id =#{departId}
</update>
<update id="removeDepart">
UPDATE departs
<set>
ISACTIVE = '0'
<if test="modifyUserName!=null and modifyUserName!=''">
, MODIFY_USER_NAME = #{modifyUserName}
</if>
<if test="modifyTrueName!=null and modifyTrueName!=''">
, MODIFY_TRUE_NAME = #{modifyTrueName}
</if>
<if test="createTime!=null and createTime!=''">
, CREATE_TIME =#{createTime}
</if>
<if test="createDate!=null and createDate!=''">
, CREATE_DATE =#{createDate}
</if>
<if test="modifyTime!=null and modifyTime!=''">
,modify_time =#{modifyTime}
</if>
</set>
WHERE DEPART_ID = #{departId}
</update>
<!-- 根据部门名称查询部门 -->
<select id="selectDepartBydepartName" resultMap="BaseResultMap">
select d.depart_id,
d.depart_name,
d.parent_id,
case d.leaf when '0' then 'true' else 'false' end as leaf,
d.modify_user_name,
create_time
from departs d
where d.depart_name = #{departName}
</select>
<!-- 根据父级id查询子集 -->
<select id="findDepartByParentId" parameterType="HashMap" resultType="HashMap">
select d.depart_id,
d.depart_name,
d.parent_id,
case d.leaf when '0' then 'true' else 'false' end as leaf,
d.modify_user_name,
create_time
from departs d
where d.parent_id = #{parent_id}
</select>
<select id="findDepartById" parameterType="java.util.HashSet" resultType="HashMap">
select d.depart_id, d.depart_name, d.parent_id,modify_user_name, create_time
from departs d where 1=1
<choose>
<when test="set != null and set.size()>0">
and d.depart_id in
<foreach collection="set" item="item" separator="," open="(" close=")" index="">
#{item}
</foreach>
</when>
<otherwise>
and d.depart_id in ('')
</otherwise>
</choose>
</select>
</mapper>

View File

@@ -0,0 +1,102 @@
<?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.saye.hospitalgd.mapper.system.DicinfoMapper">
<resultMap id="BaseResultMap" type="com.saye.hospitalgd.model.Dicinfo">
<id column="diccode" property="diccode" jdbcType="VARCHAR"/>
<result column="dicname" property="dicname" jdbcType="VARCHAR"/>
<result column="dicvalue" property="dicvalue" jdbcType="VARCHAR"/>
<result column="parent_code" property="parentCode" jdbcType="VARCHAR"/>
<result column="sort_no" property="sortNo" jdbcType="INTEGER"/>
<result column="modify_time" property="modifyTime" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="VARCHAR"/>
</resultMap>
<!-- 根据父节点查询数据 -->
<select id="findDicinfoTreeNodeList" resultMap="BaseResultMap">
select diccode,
dicname,
dicvalue,
parent_code,
sort_no,
modify_time,
create_time
from dicinfo
where parent_code = #{parentCode}
order by sort_no
</select>
<select id="findDicinfoBydiccode" resultMap="BaseResultMap">
select diccode,
dicname,
dicvalue,
parent_code,
sort_no,
modify_time,
create_time
from dicinfo
where diccode = #{diccode}
</select>
<select id="findDicinfoTreeByCode" resultMap="BaseResultMap">
select diccode,dicname,dicvalue,parent_code,sort_no,
modify_time,create_time from dicinfo
<where>
parent_code=#{parentCode}
<if test="dicvalue!=null and dicvalue!=''">
and dicvalue=#{dicvalue}
</if>
</where>
order by sort_no
</select>
<!-- 新增数据 -->
<insert id="addDicinfo">
insert into dicinfo(diccode, dicname, dicvalue, parent_code, create_time, modify_time, sort_no)
values (#{diccode}, #{dicname}, #{dicvalue}, #{parentCode}, #{create_time}, #{create_time}, #{sortNo})
</insert>
<update id="modifyDicinfo">
update dicinfo
<set>
<if test="dicname!=null and dicname!=''">
dicname=#{dicname},
</if>
<if test="dicvalue!=null and dicvalue!=''">
dicvalue=#{dicvalue},
</if>
<if test="sortNo!=null and sortNo!=''">
sort_no=#{sortNo},
</if>
<if test="modifyTime!=null and modifyTime!=''">
modify_time=#{modifyTime}
</if>
</set>
where diccode=#{diccode}
</update>
<delete id="deleteDicinfo">
delete
from dicinfo
where diccode = #{diccode}
or parent_code = #{diccode}
</delete>
<select id="selectDicinfoListByCode" parameterType="java.lang.String" resultType="HashMap">
select dicname, dicvalue, create_time, diccode
from dicinfo
where parent_code = #{parent_code}
order by dicvalue
</select>
<select id="selectDicinfoListByCondition" parameterType="HashMap" resultType="HashMap">
select dicname,dicvalue,create_time,diccode from dicinfo where parent_code = #{parentCode}
<if test="dicname!=null and dicname!=''">
and dicname like concat('%',concat(#{dicname},'%'))
</if>
order by dicvalue
</select>
<!-- 查询最大编码 -->
<select id="getMaxDicValue" resultType="HashMap" parameterType="HashMap">
select max(dicvalue) + 1 as maxDicValue
from dicinfo
where parent_code = #{parentCode}
</select>
</mapper>

View File

@@ -0,0 +1,36 @@
<?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.saye.hospitalgd.mapper.system.LoggerMapper">
<resultMap id="BaseResultMap" type="com.saye.hospitalgd.model.Logger">
<id column="loggerId" property="loggerId" jdbcType="VARCHAR"/>
<result column="logType" property="logType" jdbcType="VARCHAR"/>
<result column="information" property="information" javaType="String" jdbcType="CLOB"/>
<result column="create_time" property="create_time" jdbcType="VARCHAR"/>
<result column="user_id" property="user_id" jdbcType="VARCHAR"/>
<result column="ip" property="ip" jdbcType="VARCHAR"/>
</resultMap>
<select id="findLoggers" resultMap="BaseResultMap">
select loggerId,logType,information,create_time,user_id,ip from logger
<where>
1=1
<if test="loggerType!=null and loggerType!='' ">
and logType=#{loggerType}
</if>
<if test="startTime!=null and startTime!='' ">
and create_time&gt;=#{startTime}
</if>
<if test="endTime!=null and endTime!='' ">
and create_time&lt;=#{endTime}
</if>
</where>
order by create_time desc
</select>
<insert id="addLog" parameterType="HashMap">
insert into logger(LOGTYPE, INFORMATION, CREATE_TIME, USER_ID, IP)
values (#{logtype}, #{information}, #{create_time}, #{user_id}, #{ip})
</insert>
</mapper>

View File

@@ -0,0 +1,30 @@
<?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.saye.hospitalgd.mapper.system.MenuMapper">
<select id="findMenuByRole" parameterType="HashMap" resultType="HashMap">
SELECT MENU_ID as id, MENU_NAME as text, PARENT_ID as parentid, SEQ, LINK_URL as urls, ISACTIVE, CREATE_TIME,
RESLEVEL,LINK_IMG,LINK_IMG_SIZE FROM menu t
where t.isactive = '1'
<if test="user_id!=null and user_id!=''">
AND MENU_ID in (select a.MENU_ID from menu_role a where a.ROLE_ID in (select role_id from user_role where
user_id = #{user_id}))
</if>
order by length(t.MENU_ID),t.SEQ
</select>
<select id="findMenuByUrl" parameterType="HashMap" resultType="HashMap">
select t.menu_id, t.menu_name, t.link_url
from menu t
where t.isactive = 1
and t.link_url = #{url}
</select>
<select id="findRoleByUserAndMenu" parameterType="HashMap" resultType="HashMap">
select *
from user_role t
where t.user_id = #{userid}
and exists(select 1 from menu_role mr where mr.role_id = t.role_id and mr.menu_id = #{menu_id})
</select>
</mapper>

View File

@@ -0,0 +1,25 @@
<?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.saye.hospitalgd.mapper.system.MenuRoleMapper">
<resultMap id="BaseResultMap" type="com.saye.hospitalgd.model.MenuRole" >
<id column="menu_role_id" property="menuRoleId" jdbcType="VARCHAR" />
<result column="role_id" property="roleId" jdbcType="VARCHAR" />
<result column="menu_id" property="menuId" jdbcType="VARCHAR" />
</resultMap>
<delete id="deleteMenuRole">
DELETE FROM menu_role WHERE ROLE_ID = #{roleId}
</delete>
<insert id="insertMenuRole">
insert into menu_role(role_id,menu_id) values(#{roleId},#{menuId})
</insert>
<select id="getMenuRolesByRoleId" resultMap="BaseResultMap">
select t.menu_role_id,t.role_id,t.menu_id from menu_role t left join menu u on t.menu_id=u.menu_id
where t.role_id=#{roleId} and u.RESLEVEL='3'
</select>
</mapper>

View File

@@ -0,0 +1,69 @@
<?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.saye.hospitalgd.mapper.system.RoleMapper">
<resultMap id="BaseResultMap" type="com.saye.hospitalgd.model.Role" >
<id column="role_id" property="roleId" jdbcType="VARCHAR" />
<result column="role_name" property="roleName" jdbcType="VARCHAR" />
<result column="remark" property="remark" jdbcType="VARCHAR" />
<result column="modify_user_name" property="modifyUserName" jdbcType="VARCHAR" />
<result column="modify_true_name" property="modifyTrueName" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="VARCHAR" />
<result column="create_date" property="createDate" jdbcType="VARCHAR" />
</resultMap>
<select id="findRoleList" resultMap="BaseResultMap">
SELECT ROLE_ID, ROLE_NAME from role
</select>
<select id="searchRole" resultMap="BaseResultMap">
select ROLE_ID, ROLE_NAME,REMARK, MODIFY_USER_NAME, MODIFY_TRUE_NAME, substr(CREATE_TIME,0,19) as CREATE_TIME, CREATE_DATE
FROM role
<where>
1 = 1
<if test="roleName!=null and roleName!=''">
and ROLE_NAME like concat('%',concat(#{roleName},'%'))
</if>
<if test="date!= null and date!=''">
and CREATE_DATE = #{date}
</if>
</where>
order by CREATE_TIME
</select>
<!-- 添加角色 -->
<insert id="addRole" parameterType="hashMap">
insert into role(ROLE_ID,ROLE_NAME,REMARK, MODIFY_USER_NAME, MODIFY_TRUE_NAME)
values(#{roleId},#{roleName},'',#{userName},#{userTrueName})
</insert>
<!--删除角色 -->
<delete id="deleteRole">
DELETE FROM role WHERE ROLE_ID =#{roleId}
</delete>
<!-- 根据条件查询人员是否在管理员角色下 -->
<select id="findUserRoleListByParam" parameterType="hashMap" resultType="hashMap">
select * from user_role t left join role r on t.role_id=r.role_id
where t.user_id=#{userId}
<if test="role_name!= null and role_name!=''">
and r.role_name=#{role_name}
</if>
</select>
<update id="updateRole" parameterType="HashMap">
update role
set
ROLE_NAME = #{roleName}
where role_id = #{roleId}
</update>
<select id="findUserRoleListByUserId" parameterType="HashMap" resultType="HashMap">
select r.* from user_role t left join role r on t.role_id=r.role_id
where 1=1
<if test="userId!= null and userId!=''">
and t.user_id=#{userId}
</if>
</select>
</mapper>

View File

@@ -0,0 +1,82 @@
<?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.saye.hospitalgd.mapper.system.ServiceParamsMapper">
<resultMap id="BaseResultMap" type="com.saye.hospitalgd.model.ServiceParams">
<id column="param_id" property="paramId" jdbcType="VARCHAR"/>
<result column="param_name" property="paramName" jdbcType="VARCHAR"/>
<result column="param_code" property="paramCode" jdbcType="VARCHAR"/>
<result column="param_val" property="paramVal" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="VARCHAR"/>
<result column="modify_time" property="modifyTime" jdbcType="VARCHAR"/>
<result column="modify_user_name" property="modifyUserName" jdbcType="VARCHAR"/>
<result column="modify_true_name" property="modifyTrueName" jdbcType="VARCHAR"/>
</resultMap>
<select id="selectServiceParams" resultMap="BaseResultMap">
select param_id,param_name,param_code,param_val,create_time,modify_time,modify_user_name,modify_true_name
from service_params
<where>
1=1
<if test="paramCode!=null and paramCode!=''">
and param_code =#{paramCode}
</if>
<if test="paramName!=null and paramName!=''">
and param_name like concat('%',concat(#{paramName},'%'))
</if>
</where>
order by create_time desc
</select>
<insert id="insertServiceParams">
insert into service_params(param_name, param_code, param_val, modify_user_name, modify_true_name)
values (#{paramName}, #{paramCode}, #{paramVal}, #{modifyUserName}, #{modifyTrueName})
</insert>
<update id="updateServiceParams">
update service_params
<set>
<if test="paramName!=null and paramName!=''">
param_name =#{paramName},
</if>
<if test="paramCode!=null and paramCode!=''">
param_code =#{paramCode},
</if>
<if test="paramVal!=null and paramVal!=''">
param_val =#{paramVal},
</if>
<if test="modifyTime!=null and modifyTime!=''">
modify_time =#{modifyTime},
</if>
<if test="modifyUserName!=null and modifyUserName!=''">
modify_user_name =#{modifyUserName},
</if>
<if test="modifyTrueName!=null and modifyTrueName!=''">
modify_true_name =#{modifyTrueName}
</if>
</set>
where param_id=#{paramId}
</update>
<delete id="deleteServiceParams">
delete
from service_params
where param_id = #{paramId}
</delete>
<select id="findParamVal" resultType="HashMap">
select *
from service_params
</select>
<select id="findParamValByParamCode" resultType="HashMap">
select PARAM_NAME, PARAM_CODE, PARAM_VAL
from service_params
where PARAM_CODE = #{code}
</select>
<update id="updateServiceParamsValBycode" parameterType="HashMap">
update service_params
set param_val = #{param_val}
where param_code = #{param_code}
</update>
</mapper>

View File

@@ -0,0 +1,37 @@
<?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.saye.hospitalgd.mapper.system.UserRoleMapper">
<resultMap id="BaseResultMap" type="com.saye.hospitalgd.model.UserRole">
<id column="user_role_id" property="userRoleId" jdbcType="VARCHAR"/>
<result column="user_id" property="userId" jdbcType="VARCHAR"/>
<result column="role_id" property="roleId" jdbcType="VARCHAR"/>
</resultMap>
<insert id="insertUserRole">
insert into USER_ROLE(USER_ID, ROLE_ID)
values (#{userId}, #{roleId})
</insert>
<insert id="insertNewUserRole">
insert into USER_ROLE(USER_ID, ROLE_ID, USER_ROLE_ID)
values (#{userId}, #{roleId}, #{userRoleId})
</insert>
<delete id="deleteUserRole">
DELETE
FROM user_role
WHERE USER_ID = #{userId}
</delete>
<select id="selectUserRoleByUserId" resultMap="BaseResultMap">
select user_role_id, user_id, role_id
from user_role
where user_id = #{userId}
</select>
<select id="selectUserRoleByRoleId" resultMap="BaseResultMap">
select user_role_id, user_id, role_id
from user_role
where role_id = #{roleId}
</select>
</mapper>

View File

@@ -0,0 +1,228 @@
<?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.saye.hospitalgd.mapper.system.UsersMapper">
<resultMap id="BaseResultMap" type="com.saye.hospitalgd.model.Users">
<id column="user_id" property="userId" jdbcType="VARCHAR"/>
<result column="user_name" property="userName" jdbcType="VARCHAR"/>
<result column="password" property="password" jdbcType="VARCHAR"/>
<result column="true_name" property="trueName" jdbcType="VARCHAR"/>
<result column="depart_id" property="departId" jdbcType="VARCHAR"/>
<result column="user_name" property="userName" jdbcType="VARCHAR"/>
<result column="mobile_phone" property="mobilePhone" jdbcType="VARCHAR"/>
<result column="isactive" property="isactive" jdbcType="VARCHAR"/>
<result column="modify_user_name" property="modifyUserName" jdbcType="VARCHAR"/>
<result column="modify_true_name" property="modifyTrueName" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="VARCHAR"/>
<result column="create_date" property="createDate" jdbcType="VARCHAR"/>
<result column="modify_time" property="modifyTime" jdbcType="VARCHAR"/>
<result column="lock_time" property="lockTime" jdbcType="VARCHAR"/>
<result column="role_id" property="roleId" jdbcType="VARCHAR"/>
<result column="role_name" property="roleName" jdbcType="VARCHAR"/>
<result column="depart_name" property="departName" jdbcType="VARCHAR"/>
</resultMap>
<select id="searchUsers" resultMap="BaseResultMap">
SELECT u.USER_ID,u.USER_NAME,u.TRUE_NAME,u.MOBILE_PHONE,u.MODIFY_TIME,
u.PASSWORD,u.DEPART_ID,d.DEPART_NAME,u.ISACTIVE,u.MODIFY_USER_NAME,u.MODIFY_TRUE_NAME,u.CREATE_TIME,
u.CREATE_DATE,(SELECT GROUP_CONCAT(role_id) FROM user_role ur WHERE ur.user_id = u.user_id) role_id,
(SELECT GROUP_CONCAT(r.role_name) FROM user_role ur LEFT JOIN role r ON ur.role_id = r.role_id WHERE ur.user_id
= u.user_id)role_name
FROM users u
LEFT JOIN departs d ON u.DEPART_ID = d.DEPART_ID
<where>
1=1
<if test="departId!=null and departId.length>0 ">
and u.DEPART_ID in
<foreach collection="departId" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="trueName!=null and trueName!=''">
and u.TRUE_NAME like concat('%',concat(#{trueName},'%'))
</if>
<if test="isactive!=null and isactive!='' and isactive!=-1">
and u.ISACTIVE =#{isactive}
</if>
<if test="roleId!=null and roleId!=''">
AND EXISTS (SELECT 1 FROM user_role ur WHERE u.USER_ID = ur.USER_ID AND ur.ROLE_ID = #{roleId} )
</if>
</where>
order by u.USER_ID desc
</select>
<insert id="insertUser">
insert into users(USER_ID, USER_NAME, PASSWORD, TRUE_NAME, DEPART_ID, ISACTIVE, MODIFY_USER_NAME,
MODIFY_TRUE_NAME, CREATE_TIME, CREATE_DATE, modify_time, lock_time)
values (#{userId}, #{addUserName}, #{addPassword}, #{addTrueName}, #{departId}, 1, #{userName}, #{userTrueName},
#{create_time}, #{create_date}, #{create_time}, #{create_time})
</insert>
<!--插入excel表用户-->
<insert id="insertExcelUsers" parameterType="java.util.List">
insert into users(USER_ID, USER_NAME, PASSWORD, TRUE_NAME, DEPART_ID, ISACTIVE, MODIFY_USER_NAME,
MODIFY_TRUE_NAME, CREATE_TIME,CREATE_DATE,modify_time,lock_time)
values
<foreach collection="list" index="index" item="itm" separator=",">
(#{itm.user_id},#{itm.user_name},#{itm.password},#{itm.true_name},#{itm.depart_id},#{itm.isactive},#{itm.modify_user_name},#{itm.modify_true_name},#{itm.create_time},#{itm.create_date},#{itm.create_time},#{itm.create_time}
)
</foreach>
ON DUPLICATE KEY UPDATE
true_name=values(true_name),
depart_id=values(depart_id),
modify_user_name=values(modify_user_name),
modify_true_name=values(modify_true_name),
modify_time=values(modify_time),
</insert>
<!-- 修改用户信息 -->
<update id="modifyUsers">
UPDATE users
<set>
<if test="trueName!=null and trueName!=''">
true_name = #{trueName},
</if>
<if test="userName!=null and userName!=''">
MODIFY_USER_NAME = #{userName},
</if>
<if test="userTrueName!=null and userTrueName!=''">
MODIFY_TRUE_NAME = #{userTrueName},
</if>
<!-- <if test="createTime!=null and createTime!=''">-->
<!-- CREATE_TIME =#{createTime},-->
<!-- </if>-->
<!-- <if test="createDate!=null and createDate!=''">-->
<!-- CREATE_DATE =#{createDate},-->
<!-- </if>-->
modify_time=#{modifyTime}
</set>
where USER_ID =#{userId}
</update>
<update id="reSetPassword">
UPDATE users
<set>
<if test="password!=null and password!=''">
password = #{password},
</if>
<if test="modifyUserName!=null and modifyUserName!=''">
MODIFY_USER_NAME = #{modifyUserName},
</if>
<if test="modifyTrueName!=null and modifyTrueName!=''">
MODIFY_TRUE_NAME = #{modifyTrueName},
</if>
<!-- <if test="createTime!=null and createTime!=''">-->
<!-- MODIFY_tIME =#{createTime},-->
<!-- </if>-->
<!-- <if test="createDate!=null and createDate!=''">-->
<!-- CREATE_DATE =#{createDate}-->
<!-- </if>-->
</set>
where USER_ID =#{userId}
</update>
<update id="unableUser">
UPDATE users
<set>
<if test="isactive!=null and isactive!=''">
ISACTIVE =#{isactive},
</if>
<if test="modifyUserName!=null and modifyUserName!=''">
MODIFY_USER_NAME = #{modifyUserName},
</if>
<if test="modifyTrueName!=null and modifyTrueName!=''">
MODIFY_TRUE_NAME = #{modifyTrueName},
</if>
<!-- <if test="createTime!=null and createTime!=''">-->
<!-- CREATE_TIME =#{createTime},-->
<!-- </if>-->
<!-- <if test="createDate!=null and createDate!=''">-->
<!-- CREATE_DATE =#{createDate}-->
<!-- </if>-->
</set>
where USER_ID =#{userId}
</update>
<!-- 新增时用户名验证 查询用户名 -->
<select id="searchByName" resultMap="BaseResultMap">
SELECT u.USER_ID,
u.USER_NAME,
u.TRUE_NAME,
u.MOBILE_PHONE,
u.MODIFY_TIME,
u.lock_time,
u.PASSWORD,
u.DEPART_ID,
d.DEPART_NAME,
u.MODIFY_USER_NAME,
u.MODIFY_TRUE_NAME,
u.CREATE_DATE
FROM users u
left join departs d on u.DEPART_ID = d.DEPART_ID
where u.user_name = #{userName}
</select>
<!-- 修改用户密码 -->
<update id="modifyPassword">
update
users
set PASSWORD=#{password},
modify_time = #{modifyTime}
where user_name = #{username}
</update>
<!-- 修改锁定时间 -->
<update id="modifyLockTime">
update
users
set lock_time = #{lockTime}
where user_name = #{username}
</update>
<select id="findUserByDepartIds" parameterType="List" resultType="HashMap">
select u.USER_ID,u.USER_NAME,u.TRUE_NAME,u.MOBILE_PHONE,u.MODIFY_TIME,u.lock_time,
u.DEPART_ID,u.MODIFY_USER_NAME,u.MODIFY_TRUE_NAME,u.CREATE_DATE,
from users u where
u.DEPART_ID in
<foreach collection="idList" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
<select id="findUserByDepartIdsAndIsactive" parameterType="List" resultType="HashMap">
select u.USER_ID,u.USER_NAME,u.TRUE_NAME,u.MOBILE_PHONE,u.MODIFY_TIME,u.lock_time,
u.DEPART_ID,u.MODIFY_USER_NAME,u.MODIFY_TRUE_NAME,u.CREATE_DATE,
d.depart_name
from users u
left join departs d ON U.DEPART_ID = d.DEPART_ID
where u.ISACTIVE ='1' and
u.DEPART_ID in
<foreach collection="idList" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
and u.USER_NAME != 'admin' and u.USER_NAME != 'system'
order by u.depart_id
</select>
<select id="findUserAndIsactive" resultType="HashMap">
select u.USER_ID,
u.USER_NAME,
u.TRUE_NAME,
u.MOBILE_PHONE,
u.MODIFY_TIME,
u.lock_time,
u.DEPART_ID,
u.MODIFY_USER_NAME,
u.MODIFY_TRUE_NAME,
u.CREATE_DATE,
d.depart_name
from users u
left join departs d ON u.DEPART_ID = d.DEPART_ID
where u.ISACTIVE = '1'
and u.USER_NAME != 'admin'
and u.USER_NAME != 'system'
order by u.depart_id
</select>
</mapper>