|
@@ -27,18 +27,19 @@
|
|
|
create_time,is_enable
|
|
|
</sql>
|
|
|
|
|
|
- <select id="Query" resultType="com.kexun.entity.CooperatorField">
|
|
|
+ <select id="QueryField" resultType="com.kexun.entity.CooperatorField">
|
|
|
SELECT DISTINCT
|
|
|
field_define.field_no,
|
|
|
field_define.`name`,
|
|
|
field_define.name_zh,
|
|
|
field_define.type,
|
|
|
- field_template_ref.create_time
|
|
|
-
|
|
|
+ field_template_ref.create_time,
|
|
|
+ field_template.template_name
|
|
|
FROM
|
|
|
field_define
|
|
|
LEFT JOIN field_template_ref ON field_template_ref.field_no = field_define.field_no
|
|
|
LEFT JOIN cooperator_info ON cooperator_info.template_no = field_template_ref.template_no
|
|
|
+ LEFT JOIN field_template ON field_template.template_no = field_template_ref.template_no
|
|
|
WHERE
|
|
|
cooperator_info.cooperator_num = #{cooperatorNum};
|
|
|
|
|
@@ -46,7 +47,18 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAll" resultType="com.kexun.entity.CooperatorInfo">
|
|
|
- select * from cooperator_info
|
|
|
+ SELECT *
|
|
|
+ FROM
|
|
|
+ (SELECT *
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT *,row_number()
|
|
|
+ OVER (PARTITION BY cooperator_name ORDER BY cooperator_name desc)num from cooperator_info
|
|
|
+ )A
|
|
|
+ WHERE A.num=1) AS sub_table LEFT JOIN field_template ON field_template.template_no = sub_table.template_no
|
|
|
+ WHERE sub_table.is_deleted=0
|
|
|
+ ORDER BY sub_table.create_time DESC
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
|