DELETE FROM CellTemplateConfig a WHERE a.ID in(SELECT b.ID FROM CellTemplateConfig b INNER JOIN CellTemplate c on b.CellTemplateID=c.ID WHERE c.ReportTemplateID=#{templateDbID,jdbcType=VARCHAR})
delete a.*
FROM
CellTemplateConfig a
WHERE
ID IN (select ID from(
SELECT
b.ID
FROM
CellTemplateConfig b
INNER JOIN CellTemplate c ON b.CellTemplateID = c.ID
DELETE FROM KeyValueReference a WHERE a.ID in(SELECT b.ID FROM KeyValueReference b INNER JOIN CellTemplate c on b.CellTemplateID=c.ID WHERE c.ReportTemplateID=#{templateDbID,jdbcType=VARCHAR})
delete a.*
FROM
KeyValueReference a
WHERE
ID IN (select ID from(
SELECT
b.ID
FROM
KeyValueReference b
INNER JOIN CellTemplate c ON b.CellTemplateID = c.ID
SELECT q.Name FROM OrganizationServiceTemplateGroup p LEFT JOIN Organization q on p.OrganizationID=q.ID WHERE p.TemplateGroupID=#{templateGroupDtoID,jdbcType:VARCHAR} AND q.IsActive=1
SELECT q.Name FROM OrganizationServiceTemplateGroup p LEFT JOIN Organization q on p.OrganizationID=q.ID WHERE p.TemplateGroupID=#{templateGroupDtoID,jdbcType=VARCHAR} AND q.IsActive=1
SELECT p.ID,p.Code,p.Name,p.ReportType,q.ID as TemplateGroupID,q.Name as TemplateGroupName,p.IsActiveAssociation FROM Template p join TemplateGroup q on p.templategroupID=q.ID
<iftest="serviceTypeID">
<iftest="serviceTypeID!=null">
WHERE q.ServiceTypeID=#{serviceTypeID,jdbcType=VARCHAR}
</if>
<iftest="payTaxType!=null">
...
...
@@ -426,9 +426,29 @@ SELECT p.ID,p.Code,p.Name,p.ReportType,q.ID as TemplateGroupID,q.Name as Templat
SELECT p.ID as ID,q.ID as templateGroupID,p.Code as templateCode FROM Template p JOIN TemplateGroup q on p.TemplateGroupID=q.ID WHERE p.ID=#{ID,jdbcType=VARCHAR} LIMIT 1