공통코드 조회조건 수정

dev
mjkhan21 5 months ago
parent 1aa3d6219d
commit e309c72c14

@ -44,8 +44,8 @@
<sql id="selectCategories"><include refid="utility.paging-prefix" /> <sql id="selectCategories"><include refid="utility.paging-prefix" />
SELECT * SELECT *
FROM TB_CODE_CTGR FROM TB_CODE_CTGR
WHERE USE_YN = 'Y' <where><if test="!includeAll"> AND USE_YN = 'Y'</if>
<if test="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if> <if test="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if></where>
<include refid="utility.orderBy" /> <include refid="utility.orderBy" />
<include refid="utility.paging-suffix" /></sql> <include refid="utility.paging-suffix" /></sql>
@ -94,9 +94,9 @@ UPDATE TB_CODE_CTGR SET
<sql id="selectGroups"><include refid="utility.paging-prefix" /> <sql id="selectGroups"><include refid="utility.paging-prefix" />
SELECT * SELECT *
FROM TB_CODE_GRP FROM TB_CODE_GRP
WHERE USE_YN = 'Y' <where><if test="!includeAll"> AND USE_YN = 'Y'</if>
<if test="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if> <if test="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if>
<if test="groupIDs != null">AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if> <if test="groupIDs != null"> AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if></where>
<include refid="utility.orderBy" /> <include refid="utility.orderBy" />
<include refid="utility.paging-suffix" /></sql> <include refid="utility.paging-suffix" /></sql>
@ -151,9 +151,9 @@ UPDATE TB_CODE_GRP SET
<sql id="selectCodes"><include refid="utility.paging-prefix" /> <sql id="selectCodes"><include refid="utility.paging-prefix" />
SELECT * SELECT *
FROM TB_CMN_CODE FROM TB_CMN_CODE
WHERE USE_YN = 'Y' <where><if test="!includeAll"> AND USE_YN = 'Y'</if>
<if test='groupIDs != null'> AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if> <if test='groupIDs != null'> AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>
<if test='codes != null'>AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>)</if> <if test='codes != null'> AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>)</if></where>
<include refid="utility.orderBy" /> <include refid="utility.orderBy" />
<include refid="utility.paging-suffix" /></sql> <include refid="utility.paging-suffix" /></sql>

@ -35,7 +35,7 @@
<tbody id="groupList"> <tbody id="groupList">
</tbody> </tbody>
<template id="groupRow"> <template id="groupRow">
<tr data-key="{GRP_ID}"> <tr data-key="{GRP_ID}"{notUsed}>
<td style="text-align:center;"><input value="{GRP_ID}" onchange="codeControl.groups.select('{GRP_ID}', this.checked);" type="checkbox" class="form-check-input"></td> <td style="text-align:center;"><input value="{GRP_ID}" onchange="codeControl.groups.select('{GRP_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
<td onclick="codeControl.groups.setCurrent('{GRP_ID}')" ondblclick="codeControl.groups.getInfo({})">{GRP_ID}</td> <td onclick="codeControl.groups.setCurrent('{GRP_ID}')" ondblclick="codeControl.groups.getInfo({})">{GRP_ID}</td>
<td onclick="codeControl.groups.setCurrent('{GRP_ID}')" ondblclick="codeControl.groups.getInfo({})">{GRP_NM}</td> <td onclick="codeControl.groups.setCurrent('{GRP_ID}')" ondblclick="codeControl.groups.getInfo({})">{GRP_NM}</td>
@ -73,7 +73,7 @@
<tbody id="codeList"> <tbody id="codeList">
</tbody> </tbody>
<template id="codeRow"> <template id="codeRow">
<tr data-key="{CODE}"> <tr data-key="{CODE}"{notUsed}>
<td style="text-align:center;"><input value="{CODE}" onchange="codeControl.codes.select('{CODE}', this.checked);" type="checkbox" class="form-check-input"></td> <td style="text-align:center;"><input value="{CODE}" onchange="codeControl.codes.select('{CODE}', this.checked);" type="checkbox" class="form-check-input"></td>
<td onclick="codeControl.codes.setCurrent('{CODE}')" ondblclick="codeControl.codes.getInfo({})">{CODE}</td> <td onclick="codeControl.codes.setCurrent('{CODE}')" ondblclick="codeControl.codes.getInfo({})">{CODE}</td>
<td onclick="codeControl.codes.setCurrent('{CODE}')" ondblclick="codeControl.codes.getInfo({})">{CODE_VAL}</td> <td onclick="codeControl.codes.setCurrent('{CODE}')" ondblclick="codeControl.codes.getInfo({})">{CODE_VAL}</td>
@ -131,7 +131,10 @@ function renderGroupList() {
let trs = empty ? let trs = empty ?
[document.getElementById("groupNotFound").innerHTML] : <%-- from template#groupNotFound --%> [document.getElementById("groupNotFound").innerHTML] : <%-- from template#groupNotFound --%>
groupList.inStrings(document.getElementById("groupRow").innerHTML); <%-- from template#groupRow --%> groupList.inStrings(
document.getElementById("groupRow").innerHTML,
(tmpl, item) => tmpl.replace(/{notUsed}/gi, item.getValue("USE_YN") == "N" ? "class=\"not-used\"" : "")
); <%-- from template#groupRow --%>
$("#groupList").html(trs.join()); $("#groupList").html(trs.join());
$("th input[type='checkbox']").prop("checked", false); $("th input[type='checkbox']").prop("checked", false);
} }
@ -174,7 +177,10 @@ function renderCodeList() {
let trs = empty ? let trs = empty ?
[document.getElementById("codeNotFound").innerHTML] : <%-- from template#groupNotFound --%> [document.getElementById("codeNotFound").innerHTML] : <%-- from template#groupNotFound --%>
codeList.inStrings(document.getElementById("codeRow").innerHTML); <%-- from template#groupRow --%> codeList.inStrings(
document.getElementById("codeRow").innerHTML,
(tmpl, item) => tmpl.replace(/{notUsed}/gi, item.getValue("USE_YN") == "N" ? "class=\"not-used\"" : "")
); <%-- from template#groupRow --%>
$("#codeList").html(trs.join()); $("#codeList").html(trs.join());
$("#codeToggler").prop("checked", false); $("#codeToggler").prop("checked", false);
} }

Loading…
Cancel
Save