forked from luyan/epmet-cloud-lingshan
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
3.3 KiB
92 lines
3.3 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.epmet.dao.IcExportTemplateDao">
|
|
|
|
<resultMap type="com.epmet.entity.IcExportTemplateEntity" id="icExportTemplateMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
<result property="formCode" column="FORM_CODE"/>
|
|
<result property="name" column="NAME"/>
|
|
<result property="type" column="TYPE"/>
|
|
<result property="url" column="URL"/>
|
|
<result property="sort" column="SORT"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
</resultMap>
|
|
<select id="getTemplateConfigForExport" resultType="com.epmet.dto.result.IcExportTemplateForExportResultDTO">
|
|
SELECT
|
|
c.ID,
|
|
c.TEMP_ID,
|
|
c.LABEL,
|
|
c.PID,
|
|
c.sort,
|
|
ifi.ID AS itemId,
|
|
ifig.TABLE_NAME,
|
|
ifig.SUPPORT_ADD,
|
|
concat(ifi.COLUMN_NAME,if(ifi.COLUMN_NUM = 0,'',ifi.COLUMN_NUM)) columnName,
|
|
ifi.OPTION_SOURCE_TYPE,
|
|
ifi.OPTION_SOURCE_VALUE
|
|
FROM ic_export_template_config c
|
|
LEFT JOIN ic_form_item ifi ON c.ITEM_ID = ifi.ID
|
|
LEFT JOIN ic_form_item_group ifig ON ifi.ITEM_GROUP_ID = ifig.ID
|
|
WHERE TEMP_ID = #{tempId} and c.CUSTOMER_ID = #{customerId} and c.DEL_FLAG = '0'
|
|
ORDER BY c.PID,c.SORT
|
|
</select>
|
|
<resultMap id="BaseResultMap" type="com.epmet.dto.result.TemplateDetailResultDTO">
|
|
<result column="id" property="id"/>
|
|
<result column="label" property="label"/>
|
|
</resultMap>
|
|
<resultMap id="NodeTreeResult" type="com.epmet.dto.result.TemplateDetailResultDTO"
|
|
extends="BaseResultMap">
|
|
<collection property="children" column="id" ofType="com.epmet.dto.result.TemplateDetailResultDTO"
|
|
javaType="java.util.ArrayList" select="getChildrenTemplateDetail">
|
|
</collection>
|
|
</resultMap>
|
|
<select id="getTemplateDetail" resultMap="NodeTreeResult">
|
|
select
|
|
ID AS id,
|
|
LABEL
|
|
from
|
|
ic_export_template_config
|
|
where DEL_FLAG = 0
|
|
and TEMP_ID = #{tempId}
|
|
order by SORT
|
|
</select>
|
|
|
|
<select id="getChildrenTemplateDetail" resultMap="NodeTreeResult">
|
|
select
|
|
ID,
|
|
LABEL
|
|
from
|
|
ic_export_template_config
|
|
where DEL_FLAG = 0
|
|
and PID = #{pid}
|
|
order by SORT
|
|
</select>
|
|
|
|
<select id="selectByAgencyId" resultType="com.epmet.dto.IcExportTemplateDTO">
|
|
SELECT
|
|
id,
|
|
customer_id,
|
|
agency_id,
|
|
pids,
|
|
form_code,
|
|
`name`,
|
|
type,
|
|
url,
|
|
sort
|
|
FROM
|
|
ic_export_template
|
|
WHERE
|
|
del_flag = '0'
|
|
AND agency_id = #{agencyId}
|
|
ORDER BY sort DESC
|
|
</select>
|
|
|
|
|
|
</mapper>
|
|
|