select count(0) from epc_master_value_{rule} b where
b.DEFINE_CODE = #{mdCode}
AND b.ELE_CODE = #{eleCode}
AND b.TENANT_ID = #{tenantId}
AND DATA_START = 0
AND b.ROW_NO = #{rowNo}
select getVal_{rule}(
#{paramMap.defineCode}
, #{paramMap.eleCode}
, #{paramMap.masterCode}
, #{paramMap.eleValue}
)
update epc_master_value_{rule}
set
data_start = 99
,upd_p = -1
,upd_t = now()
where
define_code = #{mdCode}
and row_no
#{data.rowNum}
delete from epc_master_value_{rule}
where define_code = #{config.masDataDefCode}
and row_no = #{config.rowNum}
SELECT
getVal_{rule} (
#{mast.defineCode},
#{mast.inMeCode},
#{mast.outMeCode} ,
#{mast.mvCode}
);
SELECT
CODE,
ALIAS
FROM
epc_master_element_{rule}
WHERE
DEFINE_code = #{code}
AND ALIAS IN ('code', 'value')
select
ID,
DEFINE_CODE,
(
CASE
WHEN ELE_CODE = #{item.code}
THEN #{item.alias}
END
) ELE_CODE,
ELE_CODE,
ELE_VALUE,
ROW_NO
from epc_master_value_{rule}
where DEFINE_CODE = #{defineCode}
and ELE_CODE in
#{item.code}
and DEL_FLAG = 0
and ROW_NO in(select ROW_NO from epc_master_value_{rule} where DEFINE_CODE = #{defineCode} and ELE_VALUE in
#{item}
)
and ROW_NO in(select ROW_NO from epc_master_value_{rule} where DEFINE_CODE = #{defineCode}
and ELE_CODE in
#{item.code}
and ELE_VALUE LIKE CONCAT('%',#{value},'%'))
or ROW_NO in(select ROW_NO from epc_master_value_{rule} where DEFINE_CODE = #{defineCode}
and ELE_CODE in
#{item.code}
and ELE_VALUE LIKE CONCAT('%',#{value},'%'))
ORDER BY ROW_NO
limit 200
SELECT
DISTINCT
ELE_VALUE,ROW_NO
FROM
epc_master_value_{rule} T1
RIGHT JOIN (
SELECT
mse.DEFINE_CODE,
mse.CODE,
mse.ALIAS
FROM
epc_master_element_{rule} mse
WHERE
mse.DEFINE_CODE = #{code}
AND mse.ALIAS IN ('code', 'value')
) T2
ON T2.DEFINE_CODE = T1.DEFINE_CODE
AND T2.CODE = T1.ELE_CODE
ORDER BY ROW_NO,ALIAS
SELECT
(
select T3.ELE_VALUE FROM epc_master_value_{rule} T3
WHERE
T3.DEFINE_CODE = T2.DEFINE_CODE
and T3.ROW_NO = T2.ROW_NO
and T3.ELE_CODE = #{meCode}
and T3.DEL_FLAG = 0
limit 1
) result
FROM
(
select
DISTINCT
T1.DEFINE_CODE,
T1.ELE_CODE,
T1.ELE_VALUE,
T1.ROW_NO
from epc_master_value_{rule} T1
WHERE T1.DEFINE_CODE = #{mdCode}
AND T1.DEL_FLAG = 0
ORDER BY
T1.ROW_NO
)T2
(T2.ELE_CODE, T2.ELE_VALUE) = (#{item.leftMeCode},#{item.meValue})
GROUP BY T2.ROW_NO
HAVING count(ROW_NO) = ${params.size()}
LIMIT 1
select
id,
${ele.tableField} as #{ele.meCode}
from ${name}
where data_start = 0 and isBlock = '0'
delete from epc_master_value_{rule}
SELECT
DISTINCT
ELE_VALUE,ROW_NO
FROM
epc_master_value_{rule} T1
RIGHT JOIN (
SELECT
mse.DEFINE_CODE,
mse.CODE,
mse.ALIAS
FROM
epc_master_element_{rule} mse
WHERE
mse.DEFINE_CODE = #{code}
AND mse.ALIAS IN ('code', 'value')
) T2
ON T2.DEFINE_CODE = T1.DEFINE_CODE
AND T2.CODE = T1.ELE_CODE
and ROW_NO in(select ROW_NO from epc_master_value_{rule} where DEFINE_CODE = #{code} and ELE_VALUE LIKE CONCAT('%',#{value},'%'))
and ROW_NO in(select ROW_NO from epc_master_value_{rule} where DEFINE_CODE = #{code} and ELE_VALUE in
#{item}
)
ORDER BY ROW_NO,ALIAS
LIMIT 200
SELECT
a.ELE_VALUE
FROM
epc_master_value_{rule} a
WHERE
a.DEFINE_CODE = #{master.defineCode}
AND a.ELE_CODE = (
SELECT
CODE
FROM
epc_master_element_{rule} b
WHERE
b.DEFINE_CODE = #{master.defineCode}
AND b.alias = 'code'
limit 1
)
AND a.ROW_NO = (
SELECT
ROW_NO
FROM
epc_master_value_{rule} c
WHERE
c.DEFINE_CODE = #{master.defineCode} and
c.ELE_VALUE = #{master.eleValue}
limit 1
)
limit 1
SELECT
ELE_CODE,
ELE_VALUE,ROW_NO
FROM
epc_master_value_{rule} T1
where DEFINE_CODE = #{code}
ORDER BY ROW_NO
insert into ${tableName}
${key}
values
#{val}
delete from ${tableName}
where id = #{id}
update ${tableName} set
${key}=#{val}
,company_code = #{companyCode}
,company_name = #{companyName}
where id = #{id}
select
${resField}
from ${tableName}
${param.fieldName} = #{param.meValue}
limit 1
select ${field}
from ${tableName}
where ${conditionField} = #{conditionValue}
LIMIT 1
SELECT
${code} `code`,
${value} `value`
FROM
${tableName}
and ${value} LIKE CONCAT('%', #{eleValue}, '%')
and ${code} in
#{item}