diff --git a/src/main/resources/sqlmapper/mappers/cmmn/log.xml b/src/main/resources/sqlmapper/mappers/cmmn/log.xml index fd57e29..549844a 100644 --- a/src/main/resources/sqlmapper/mappers/cmmn/log.xml +++ b/src/main/resources/sqlmapper/mappers/cmmn/log.xml @@ -25,83 +25,57 @@ + select (ROW_NUMBER() OVER()) AS RNUM, + aa.* + from (select pl1.codenm place1str, + b.recentdate, + pl2.codenm PLACE2STR, + pl3.codenm PLACE3STR, + pst.codenm POSITIONSTR, + jt.codenm JOBTYPESTR, + a.* + from tagent a + inner join tcode pl1 on pl1.code1 = 'C001' and a.place1 = pl1.code2 + inner join tcode pl2 on a.place1 = pl2.code1 and a.place2 = pl2.code2 + inner join tcode pl3 on pl3.code1 = 'C009' and a.place3 = pl3.code2 + inner join tcode pst on pst.code1 = 'C002' and a.position = pst.code2 + inner join tcode jt on jt.code1 = 'C003' and a.jobtype = jt.code2 + left outer join (SELECT IO_USERID, TO_CHAR(MAX(IO_REGDATE), 'YYYY-MM-DD HH24:MI:SS') AS RECENTDATE + FROM H3_LOGINOUT_LOG + + + AND IO_PLACE1 = #{place1} + + + AND IO_NAME LIKE '%' || #{name} || '%' + + + GROUP BY IO_USERID ) B ON A.USERID = B.IO_USERID + + + AND PLACE1 = #{place1} + + + AND NAME LIKE '%' || #{name} || '%' + + + ORDER BY + + ${orderkey} DESCASC, + + PLACE1, PLACE2, POSITION DESC, NAME + limit #{recordCountPerPage} offset #{firstIndex} ) aa +