<?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.model.mpk.dao.MpkFileDao">
|
|
<resultMap id="mpkFile" type="com.iailab.module.model.mpk.dto.MpkFileDTO">
|
<id property="id" column="id"/>
|
<result property="pyName" column="py_name"/>
|
<result property="filePath" column="file_path"/>
|
<result property="pkgName" column="pkg_name"/>
|
<result property="className" column="class_name"/>
|
<result property="pyModule" column="py_module"/>
|
<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.model.mpk.entity.ModelMethodEntity">
|
<id property="id" column="method_id"/>
|
<result property="methodName" column="method_name"/>
|
<result property="dataLength" column="data_length"/>
|
<result property="model" column="model"/>
|
</collection>
|
</resultMap>
|
|
<select id="get" resultMap="mpkFile">
|
SELECT
|
a.*,
|
b.id method_id,
|
b.method_name,
|
b.data_length,
|
b.model
|
FROM
|
t_mpk_file a
|
LEFT JOIN t_mpk_model_method b ON a.id = b.mpk_file_id
|
WHERE a.id = #{id}
|
</select>
|
<select id="selectByIds" resultMap="mpkFile">
|
SELECT
|
a.*,
|
b.id method_id,
|
b.method_name,
|
b.data_length,
|
b.model
|
FROM
|
t_mpk_file a
|
LEFT JOIN t_mpk_model_method b ON a.id = b.mpk_file_id
|
WHERE a.id in
|
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
#{item}
|
</foreach>
|
</select>
|
<select id="getProjectModelCount" resultType="java.lang.Integer" parameterType="java.lang.String">
|
SELECT
|
count(*)
|
FROM
|
t_mpk_project_model
|
WHERE
|
project_id = #{projectId}
|
</select>
|
<select id="getProjectModel" resultMap="mpkFile">
|
SELECT
|
t3.*,t4.method_name,t4.data_length,t4.model
|
FROM
|
(
|
SELECT
|
t2.id,
|
t2.py_name,
|
t2.pkg_name,
|
t2.py_module,
|
t2.remark,
|
t2.create_date
|
FROM
|
t_mpk_project_model t1
|
LEFT JOIN t_mpk_file t2 ON t1.model_id = t2.id
|
WHERE
|
t1.project_id = #{params.projectId}
|
<if test="params.pyName != null and params.pyName != ''">
|
AND t2.py_name LIKE CONCAT('%',#{params.pyName},'%')
|
</if>
|
ORDER BY
|
t2.create_date DESC
|
LIMIT #{params.offset},#{params.pageSize}
|
) t3
|
LEFT JOIN t_mpk_model_method t4 ON t3.id = t4.mpk_file_id
|
</select>
|
</mapper>
|