/*!mycat:sql=select tenantid from FORMDATAMANAGER WHERE TENANTID = '${tenantID}' AND FROMID = '${formID}' */
select createUser from
FORMDATA_${tenantID}_${formID}
WHERE
TENANTID = #{tenantID}
AND dataRowNum = #{dataRowNum}
SELECT
COUNT(0)
FROM
formfield
WHERE
FORMID = #{formID}
AND TENANTID = #{tenantID}
AND FIELDTYPE != "subform"
AND PARENTSUBFORMNUM != 0
SELECT
formset.BUSSINESSSYSTEM,
formset.CREATEDATETIME,
formset.CREATEUSER
FROM
formset,
formversion
WHERE
formset.FORMSETID = formversion.FORMSETID
AND formversion.FORMID = #{formID}
AND formversion.TENANTID = #{tenantID}
SELECT
mainForm.CREATEDATETIME as createDateTime,
mainForm.CREATEUSER as createUser,
mainForm.ENCLOSUREINFO as enclosureInfo,
process.process_state as processState
FROM
${formName} AS mainForm
LEFT JOIN process_log AS process
ON process.FORMID = #{formID}
AND process.tenant_id = mainForm.TENANTID
AND process.DATAROWNUM = mainForm.DATAROWNUM
WHERE
mainForm.DATAROWNUM = #{datarowNum}
AND mainForm.TENANTID = #{tenantID}
SELECT
`COLUMNORDERNUM`,
`FIELDKEY`
FROM
formfield
WHERE
FORMID = #{formID}
AND TENANTID = #{tenantID}
AND FIELDKEY = #{fieldKey}
SELECT
`FORMID`,
`TENANTID`,
`COLUMNORDERNUM`,
`PROPERTY`,
`VALUE`,
`DELETEFLG`,
`CREATEUSER`,
`CREATEDATETIME`,
`UPDATEUSER`,
`UPDATEDATETIME`
FROM
fieldproperty
WHERE
FORMID = #{formID}
AND TENANTID = #{tenantID}
AND COLUMNORDERNUM = #{columnOrderNum}
SELECT
f1.`FORMID`,
f1.`TENANTID`,
f1.`COLUMNORDERNUM`,
f1.`PROPERTY`,
f1.`VALUE`,
f1.`DELETEFLG`,
f1.`CREATEUSER`,
f1.`CREATEDATETIME`,
f1.`UPDATEUSER`,
f1.`UPDATEDATETIME`
FROM
fieldproperty f1
left join formfield f2 on f1.COLUMNORDERNUM = f2.COLUMNORDERNUM and f2.FORMID = f1.FORMID and f2.TENANTID = f1.TENANTID
WHERE
f1.FORMID = #{formID}
AND f1.TENANTID = #{tenantID}
AND f2.FIELDKEY = #{field}
SELECT
`TENANTID`,
`FORMID`,
`COLUMNORDERNUM`,
`FIELDTYPE`,
`PARENTSUBFORMNUM`,
`FIELDORDERNUM`,
`FIELDKEY`,
`DELETEFLG`,
`CREATEUSER`,
`CREATEDATETIME`,
`UPDATEUSER`,
`UPDATEDATETIME`,
`FIELDISSHOW`,
`SEARCHISSHOW`
FROM
FORMFIELD
WHERE
FORMID = #{formID}
AND TENANTID = #{tenantID}
AND PARENTSUBFORMNUM = 0
AND DELETEFLG = 0
AND FIELDTYPE IN (
'radio',
'dropdownlist',
'checkbox',
'tree'
);
SELECT
`TENANTID`,
`FORMID`,
`COLUMNORDERNUM`,
`FIELDTYPE`,
`PARENTSUBFORMNUM`,
`FIELDORDERNUM`,
`FIELDKEY`,
`DELETEFLG`,
`CREATEUSER`,
`CREATEDATETIME`,
`UPDATEUSER`,
`UPDATEDATETIME`,
`FIELDISSHOW`,
`SEARCHISSHOW`
FROM
FORMFIELD
WHERE
FORMID = #{formID}
AND TENANTID = #{tenantID}
AND PARENTSUBFORMNUM != 0
AND DELETEFLG = 0
AND FIELDTYPE IN (
'radio',
'dropdownlist',
'checkbox',
'tree'
);
SELECT
`TENANTID`,
`FORMID`,
`COLUMNORDERNUM`,
`FIELDTYPE`,
`PARENTSUBFORMNUM`,
`FIELDORDERNUM`,
`FIELDKEY`,
`DELETEFLG`,
`CREATEUSER`,
`CREATEDATETIME`,
`UPDATEUSER`,
`UPDATEDATETIME`,
`FIELDISSHOW`,
`SEARCHISSHOW`
FROM
FORMFIELD
WHERE
FORMID = #{formID}
AND TENANTID = #{tenantID}
AND PARENTSUBFORMNUM = 0
AND DELETEFLG = 0
SELECT
m.FORMDATATABLE
FROM
formdatamanager m
WHERE
m.FORMID = #{formID}
AND m.SUBFORMFLG = 0
AND tenantID = #{tenantID}
${excuteSql}
{mycat}
select
DATAROWNUM,processState,processLog,processTask,processUser
,
${field.fieldKey}
from {formname}
where deleteFlg = 0
and TENANTID = '{tenantId}'
and ${where}
order by DATAROWNUM desc
SELECT
PROPERTY,
`VALUE`
FROM
FIELDPROPERTY
WHERE
FORMID = #{formID}
AND TENANTID = #{tenantID}
AND PROPERTY IN (
'prefix',
'suffix',
'generationLength',
'gengerate'
)
SELECT
PROPERTY,
`VALUE`
FROM
FIELDPROPERTY
WHERE
FORMID = #{formID}
AND TENANTID = #{tenantID}
AND COLUMNORDERNUM = #{columnordernum}
AND PROPERTY IN (
'autoType',
'autoTypeNumber',
'autoTypePrefix'
)
SELECT
count(FORMID)
FROM
FORMDATAMANAGER
WHERE
FORMID = #{formID}
AND TENANTID = #{tenantID}
select
formfield.formid as formid,
formfield.tenantid as tenantid,
formfield.columnordernum as columnordernum,
case when fieldproperty.value = 'password' then 'password' else formfield.fieldtype end as fieldtype,
formfield.parentsubformnum as parentsubformnum,
formfield.fieldordernum as fieldordernum,
formfield.fieldkey as fieldkey,
fieldproperty.value as value,
formbase.fieldset
from
formfield
left join fieldproperty
on
formfield.formid = fieldproperty.formid
and formfield.tenantid = fieldproperty.tenantid
and formfield.columnordernum = fieldproperty.columnordernum
and (fieldproperty.property = 'datatype' or fieldproperty.property = 'format' or fieldproperty.property = 'chooseForm')
and fieldproperty.deleteflg = '0'
left join formbase
on
formfield.formid = formbase.formid
and formfield.tenantid = formbase.tenantid
where
formfield.formid = #{formID} and
formfield.tenantid = #{tenantID} and
formfield.deleteflg = '0'
order by formfield.fieldordernum
SELECT
formfield.formid AS formid,
formfield.tenantid AS tenantid,
formfield.columnordernum AS columnordernum,
CASE
WHEN fieldproperty.
VALUE
= 'password' THEN
'password'
ELSE
formfield.fieldtype
END AS fieldtype,
formfield.parentsubformnum AS parentsubformnum,
formfield.fieldordernum AS fieldordernum,
formfield.fieldkey AS fieldkey,
fieldproperty.
VALUE
AS
VALUE
FROM
formfield
LEFT JOIN fieldproperty ON formfield.formid = fieldproperty.formid
AND formfield.tenantid = fieldproperty.tenantid
AND formfield.columnordernum = fieldproperty.columnordernum
AND (
fieldproperty.property = 'datatype'
OR fieldproperty.property = 'format'
)
AND fieldproperty.deleteflg = '0'
WHERE
formfield.formid = #{formID}
AND formfield.tenantid = #{tenantID}
AND formfield.deleteflg = '0'
AND formfield.FIELDTYPE != 'subform'
AND formfield.PARENTSUBFORMNUM = 0
ORDER BY
formfield.fieldordernum
SELECT
PROPERTY,
VALUE
FROM
FIELDPROPERTY
WHERE
FIELDPROPERTY.FORMID = #{formID} AND
FIELDPROPERTY.TENANTID = #{tenantID} AND
FIELDPROPERTY.COLUMNORDERNUM = #{columnOrderNum} AND
FIELDPROPERTY.PROPERTY IN ('datasourcetype','custom','datasource','masterData','apiUrl','textcolumn','valuecolumn','namecolumn','apiIdKey','apiPIdKey') AND
FIELDPROPERTY.DELETEFLG = '0'
UPDATE
FORMFIELD
SET
FIELDISSHOW = #{fieldIsShow}
WHERE
FORMID = #{formID} AND
TENANTID = #{tenantID} AND
FIELDKEY = #{fieldKey}
UPDATE
FORMFIELD
SET
SEARCHISSHOW = #{searchIsShow}
WHERE
FORMID = #{formID} AND
TENANTID = #{tenantID} AND
FIELDKEY = #{fieldKey}
SELECT
MAX(columnOrderNum) AS MAXNUM
FROM
FORMFIELD
WHERE
FORMID = #{formID} AND
TENANTID = #{tenantID} AND
DELETEFLG = '0'
ORDER BY FIELDORDERNUM
SELECT
FORMID,
TENANTID,
FORMDATANUM,
FORMDATATABLE,
DATAROWNUM
FROM
FORMDATAMANAGER
WHERE
FORMID = #{formID} AND
TENANTID = #{tenantID} AND
DELETEFLG = '0'
ORDER BY FORMDATANUM
SELECT
FORMID,
TENANTID,
FORMDATANUM,
FORMDATATABLE,
DATAROWNUM
FROM
FORMDATAMANAGER
WHERE
FORMID = #{formID} AND
TENANTID = #{tenantID} AND
FORMDATANUM = #{formdataNum} AND
DELETEFLG = '0'
ORDER BY FORMDATANUM
${executesql}
${executesql}
SELECT
FORMFIELD.FORMID,
FORMFIELD.TENANTID,
FORMFIELD.COLUMNORDERNUM,
FORMFIELD.FIELDTYPE,
FORMFIELD.PARENTSUBFORMNUM,
FORMFIELD.FIELDORDERNUM,
FORMFIELD.FIELDKEY
FROM
FORMFIELD
WHERE
FORMFIELD.FORMID = #{formID} AND
FORMFIELD.TENANTID = #{tenantID} AND
FORMFIELD.DELETEFLG = '0'
ORDER BY FORMFIELD.FIELDORDERNUM
SELECT
FORMFIELD.FORMID,
FORMFIELD.TENANTID,
FORMFIELD.COLUMNORDERNUM,
FORMFIELD.FIELDTYPE,
FORMFIELD.PARENTSUBFORMNUM,
FORMFIELD.FIELDORDERNUM,
FORMFIELD.FIELDKEY
FROM
FORMFIELD
WHERE
FORMFIELD.FORMID = #{formID} AND
FORMFIELD.TENANTID = #{tenantID} AND
FORMFIELD.DELETEFLG = '0'
ORDER BY FORMFIELD.FIELDORDERNUM
SELECT
FORMID,
TENANTID,
FORMDATANUM,
FORMDATATABLE,
SUBFORMFLG,
SUBFORMFIELDKEY,
DATAROWNUM
FROM
FORMDATAMANAGER
WHERE
FORMID = #{formID} AND
TENANTID = #{tenantID} AND
DELETEFLG = '0'
SELECT
FORMID,
TENANTID,
FORMDATANUM,
FORMDATATABLE,
SUBFORMFLG,
SUBFORMFIELDKEY,
DATAROWNUM
FROM
FORMDATAMANAGER
WHERE
FORMID = #{formID} AND
TENANTID = #{tenantID} AND
FORMDATANUM = 0 AND
DELETEFLG = '0'
FOR UPDATE
UPDATE
FORMDATAMANAGER
SET
DATAROWNUM = #{datarowNum}
WHERE
FORMID = #{formID} AND
TENANTID = #{tenantID} AND
FORMDATANUM = 0 AND
DELETEFLG = '0'
${excuteSql}
${excuteSql}
${excuteSql}
SELECT
FORMID,
TENANTID,
FORMDATANUM,
FORMDATATABLE,
SUBFORMFLG,
SUBFORMFIELDKEY,
DATAROWNUM
FROM
FORMDATAMANAGER
WHERE
FORMID = #{formID} AND
TENANTID = #{tenantID} AND
FORMDATANUM = #{formdataNum} AND
DELETEFLG = '0'
/*!mycat:sql=select tenantid from FORMDATAMANAGER WHERE TENANTID = '%s' AND FROMID = '%s' */
UPDATE
FORMDATA_${formState.tenantID}_${formState.formID}
SET
FORMSTATE = #{formState.formStateData}
WHERE
TENANTID = #{formState.tenantID}
SELECT
formfield.PARENTSUBFORMNUM,
formfield.FIELDKEY,
formfield.FIELDTYPE,
fieldproperty.`VALUE` title
FROM
formfield
LEFT JOIN
fieldproperty
ON formfield.FORMID = fieldproperty.FORMID
AND formfield.TENANTID = fieldproperty.TENANTID
AND formfield.COLUMNORDERNUM = fieldproperty.COLUMNORDERNUM
AND fieldproperty.PROPERTY = 'title'
AND fieldproperty.DELETEFLG = '0'
WHERE
formfield.FORMID = '${formID}'
AND formfield.TENANTID = '${tenantID}'
AND formfield.DELETEFLG = '0'
AND formfield.FIELDTYPE != 'subform'
AND formfield.FIELDKEY != 'DATAROWNUM'
AND formfield.FIELDTYPE != 'mytext'
select
formfield.formid as formid,
formfield.tenantid as tenantid,
formfield.columnordernum as columnordernum,
case when fieldproperty.value = 'password' then 'password' else formfield.fieldtype end as fieldtype,
formfield.parentsubformnum as parentsubformnum,
formfield.fieldordernum as fieldordernum,
formfield.fieldkey as fieldkey,
fieldproperty.value as value,
formbase.fieldset
from
formfield
left join fieldproperty
on
formfield.formid = fieldproperty.formid
and formfield.tenantid = fieldproperty.tenantid
and formfield.columnordernum = fieldproperty.columnordernum
and (fieldproperty.property = 'datatype' or fieldproperty.property = 'format' or fieldproperty.property = 'chooseForm')
and fieldproperty.deleteflg = '0'
left join formbase
on
formfield.formid = formbase.formid
and formfield.tenantid = formbase.tenantid
where
formfield.formid = #{formID} and
formfield.tenantid = #{tenantID} and
formfield.deleteflg = '0'
limit 1