From 23bd719cebe5feeff4e48fde925b0b39755eea93 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 15 十一月 2022 10:59:50 +0800 Subject: [PATCH] 2022.11.15 --- src/main/resources/mapper/LedgerRecordMapper.xml | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/src/main/resources/mapper/LedgerRecordMapper.xml b/src/main/resources/mapper/LedgerRecordMapper.xml index c941cb4..a63755e 100644 --- a/src/main/resources/mapper/LedgerRecordMapper.xml +++ b/src/main/resources/mapper/LedgerRecordMapper.xml @@ -14,7 +14,7 @@ <result column="CI_GUID" property="ciGuid" jdbcType="VARCHAR" /> <result column="CI_Name" property="ciName" jdbcType="VARCHAR" /> <result column="LR_EASubmitKind" property="lrEasubmitkind" jdbcType="TINYINT" /> - <result column="LR_VerifierID" property="lrVerifierid" jdbcType="INTEGER" /> + <result column="LR_VerifierID" property="lrVerifierid" jdbcType="VARCHAR" /> <result column="LR_VerifierRealName" property="lrVerifierrealname" jdbcType="VARCHAR" /> <result column="LR_VerifyDate" property="lrVerifydate" jdbcType="TIMESTAMP" /> <result column="LR_IsVerify" property="lrIsverify" jdbcType="BIT" /> @@ -61,4 +61,26 @@ limit #{param6}, #{param7} </if> </select> + + <select id="getNeedCopyLedgers" resultMap="BaseResultMap"> + SELECT * FROM + (SELECT + @row_number:=CASE WHEN @median_group = t_ledger.g THEN @row_number+1 else 1 END AS i, + @median_group:= t_ledger.g AS median_group, + t_ledger.* + FROM + ( + SELECT + a.*, + STR_TO_DATE(concat(a.LR_Year,'-',a.LR_Month,'-',a.LR_Day),'%Y-%m-%d') as d, + CONCAT(a.LR_SubmitID, a.LS_SubTypeId) as g + FROM + ea_t_ledgerrecord AS a + ORDER BY LR_SubmitID, LS_SubTypeId, d DESC + ) as t_ledger + LEFT JOIN sm_t_userinfo AS b ON t_ledger.LR_SubmitID = b.UI_GUID + LEFT JOIN ea_t_ledgersubtype AS c ON t_ledger.LS_SubTypeId = c.LS_SubTypeId + WHERE b.UI_IsEnable = TRUE AND c.L_Auto_Copy = TRUE) as r + WHERE i = 1 + </select> </mapper> \ No newline at end of file -- Gitblit v1.9.3