<?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.iailab.module.mhub.mdk.dao.MdkModelFileDao">
|
<resultMap id="mpkFile" type="com.iailab.module.mhub.mdk.vo.MdkModelFileRespVO">
|
<id property="id" column="id"/>
|
<result property="pyName" column="py_name"/>
|
<result property="pyChineseName" column="py_chinese_name"/>
|
<result property="filePath" column="file_path"/>
|
<result property="pyType" column="py_type"/>
|
<result property="pkgName" column="pkg_name"/>
|
<result property="className" column="class_name"/>
|
<result property="pyModule" column="py_module"/>
|
<result property="icon" column="icon"/>
|
<result property="menuName" column="menu_name"/>
|
<result property="groupName" column="group_name"/>
|
<result property="remark" column="remark"/>
|
<result property="creator" column="creator"/>
|
<result property="createDate" column="create_date"/>
|
<result property="updater" column="updater"/>
|
<result property="updateDate" column="update_date"/>
|
<collection property="modelMethods" ofType="com.iailab.module.mhub.mdk.vo.MdkModelMethodRespVO">
|
<id property="id" column="method_id"/>
|
<result property="methodName" column="method_name"/>
|
<result property="dataLength" column="data_length"/>
|
<result property="model" column="model"/>
|
<result property="resultKey" column="result_key"/>
|
<collection property="methodSettings" ofType="com.iailab.module.mhub.mdk.vo.MdkModelSettingRespVO">
|
<id property="id" column="setting_id"/>
|
<result property="settingKey" column="setting_key"/>
|
<result property="name" column="setting_name"/>
|
<result property="value" column="value"/>
|
<result property="type" column="type"/>
|
<result property="valueType" column="value_type"/>
|
<result property="max" column="max"/>
|
<result property="min" column="min"/>
|
<collection property="settingSelects" ofType="com.iailab.module.mhub.mdk.vo.MdkSettingSelectRespVO">
|
<id property="id" column="select_id"/>
|
<result property="selectKey" column="select_key"/>
|
<result property="name" column="select_name"/>
|
</collection>
|
</collection>
|
</collection>
|
</resultMap>
|
|
<select id="get" resultMap="mpkFile">
|
SELECT
|
a.*,
|
b.id method_id,
|
b.method_name,
|
b.data_length,
|
b.model,
|
b.result_key,
|
c.id setting_id,
|
c.setting_key,
|
c.name setting_name,
|
c.value,
|
c.type,
|
c.value_type,
|
c.max,
|
c.min,
|
d.id select_id,
|
d.select_key,
|
d.name select_name
|
FROM t_mdk_model_file a
|
LEFT JOIN t_mdk_model_method b ON a.id = b.mpk_file_id
|
LEFT JOIN t_mdk_model_setting c ON b.id = c.method_id
|
LEFT JOIN t_mdk_setting_select d ON c.id = d.setting_id
|
WHERE a.id = #{id}
|
ORDER BY b.sort,c.sort,d.sort
|
</select>
|
<select id="selectByIds" resultMap="mpkFile">
|
SELECT
|
a.*,
|
b.id method_id,
|
b.method_name,
|
b.data_length,
|
b.model,
|
b.result_key,
|
c.id setting_id,
|
c.setting_key,
|
c.name setting_name,
|
c.value,
|
c.type,
|
c.value_type,
|
c.max,
|
c.min,
|
d.id select_id,
|
d.select_key,
|
d.name select_name
|
FROM t_mdk_model_file a
|
LEFT JOIN t_mdk_model_method b ON a.id = b.mpk_file_id
|
LEFT JOIN t_mdk_model_setting c ON b.id = c.method_id
|
LEFT JOIN t_mdk_setting_select d ON c.id = d.setting_id
|
LEFT JOIN t_mdk_file_menu e ON e.name = a.menu_name
|
LEFT JOIN t_mdk_file_group f ON f.menu_id = e.id and f.name = a.group_name
|
WHERE a.id in
|
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
#{item}
|
</foreach>
|
ORDER BY b.sort,c.sort,d.sort,e.sort,f.sort,a.create_date
|
</select>
|
<select id="list" resultMap="mpkFile" parameterType="map">
|
SELECT
|
a.*,
|
b.id method_id,
|
b.method_name,
|
b.data_length,
|
b.model,
|
b.result_key,
|
c.id setting_id,
|
c.setting_key,
|
c.name setting_name,
|
c.value,
|
c.type,
|
c.value_type,
|
c.max,
|
c.min,
|
d.id select_id,
|
d.select_key,
|
d.name select_name
|
FROM t_mpk_file a
|
LEFT JOIN t_mdk_model_method b ON a.id = b.mpk_file_id
|
LEFT JOIN t_mdk_model_setting c ON b.id = c.method_id
|
LEFT JOIN t_mdk_setting_select d ON c.id = d.setting_id
|
LEFT JOIN t_mdk_file_menu e ON e.name = a.menu_name
|
LEFT JOIN t_mdk_file_group f ON f.menu_id = e.id and f.name = a.group_name
|
<where>
|
<if test="params.pyType != null and params.pyType != ''">
|
AND a.py_type = #{params.pyType}
|
</if>
|
</where>
|
ORDER BY b.sort,c.sort,d.sort,e.sort,f.sort,a.create_date
|
</select>
|
</mapper>
|