dcs 11 months ago
parent
commit
702980fcf0

+ 13 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/model/Project.java

@@ -23,6 +23,11 @@ public class Project {
      */
     private long organizationId;
 
+    /**
+     * 组织名称
+     */
+    private String organizationName;
+
     /**
      * 名称
      */
@@ -79,6 +84,14 @@ public class Project {
         this.organizationId = organizationId;
     }
 
+    public String getOrganizationName() {
+        return organizationName;
+    }
+
+    public void setOrganizationName(String organizationName) {
+        this.organizationName = organizationName;
+    }
+
     public String getName() {
         return name;
     }

+ 7 - 6
virgo.api/src/main/resources/mapper/ProjectMapper.xml

@@ -7,6 +7,7 @@
 		<result column="name" property="name"/>
 		<result column="createDate" property="createDate"/>
 		<result column="organizationId" property="organizationId"/>
+		<result column="organizationName" property="organizationName"/>
 		<result column="address" property="address"/>
 		<result column="picture" property="picture"/>
 		<result column="tagIds" property="tagIds"/>
@@ -103,17 +104,17 @@
 	</select>
 
 	<select id="getLimit" resultMap="result">
-		SELECT * FROM project
+		SELECT a.*, b.name as organizationName FROM project a LEFT JOIN mgr_organization b ON a.organizationId = b.id
 		<where>
-			and deleteState = 0
-			<if test="p.organizationId!=0">and organizationId=#{p.organizationId}</if>
+			and a.deleteState = 0
+			<if test="p.organizationId!=0">and a.organizationId=#{p.organizationId}</if>
 			<if test="p.tagIds != null">and
 				<foreach item="tagId" collection="p.tagIds.split(',')" open="(" separator=" and " close=")">
-					FIND_IN_SET (#{tagId}, tagIds)
+					FIND_IN_SET (#{tagId}, a.tagIds)
 				</foreach>
 			</if>
-			<if test="p.name!=null">and name=#{p.name}</if>
-			<if test="p.createDate!=null and p.createDate !=''">and createDate = #{p.createDate}</if>
+			<if test="p.name!=null">and a.name=#{p.name}</if>
+			<if test="p.createDate!=null and p.createDate !=''">and a.createDate = #{p.createDate}</if>
 		</where>
 		limit #{currIndex} , #{pageSize}
 	</select>