|
@@ -46,8 +46,22 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAll" resultType="com.kexun.entity.CooperatorInfo">
|
|
|
- select * from cooperator_info
|
|
|
- order by create_time desc
|
|
|
+
|
|
|
+ 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 AND is_deleted=0) AS coo
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT template_no
|
|
|
+ FROM field_template
|
|
|
+ WHERE is_deleted=0
|
|
|
+ ) tno
|
|
|
+ ON coo.template_no=tno.template_no
|
|
|
+ ORDER BY coo.create_time DESC
|
|
|
|
|
|
|
|
|
</select>
|