|
@@ -7,7 +7,9 @@
|
|
|
<resultMap type="com.bosshand.virgo.core.model.MgrOrganizationProject" id="mgrOrganizationProjectResult" >
|
|
|
<id column="id" property="id"/>
|
|
|
<result column="organizationId" property="organizationId"/>
|
|
|
+ <result column="organizationName" property="organizationName"/>
|
|
|
<result column="projectId" property="projectId"/>
|
|
|
+ <result column="projectName" property="projectName"/>
|
|
|
<result column="userId" property="userId"/>
|
|
|
<result column="clientId" property="clientId"/>
|
|
|
<result column="agentId" property="agentId"/>
|
|
@@ -16,6 +18,12 @@
|
|
|
<result column="identityId" property="identityId"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <sql id="query">
|
|
|
+ select a.*, b.name as organizationName, c.name as projectName from mgr_organization_project a
|
|
|
+ left join mgr_organization b on a.organizationId = b.id
|
|
|
+ left join project c on a.projectId = c.id
|
|
|
+ </sql>
|
|
|
+
|
|
|
<select id="get" resultMap="mgrOrganizationProjectResult">
|
|
|
select * from mgr_organization_project where organizationId = #{organizationId} and userId = #{userId}
|
|
|
</select>
|
|
@@ -29,16 +37,16 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getList" resultMap="mgrOrganizationProjectResult">
|
|
|
- select * from mgr_organization_project
|
|
|
+ <include refid="query"/>
|
|
|
<where>
|
|
|
- <if test="organizationId!=0">and organizationId=#{organizationId}</if>
|
|
|
- <if test="projectId!=0">and projectId=#{projectId}</if>
|
|
|
- <if test="userId!=0">and userId=#{userId}</if>
|
|
|
- <if test="clientId!=0">and clientId=#{clientId}</if>
|
|
|
- <if test="agentId!=0">and agentId=#{agentId}</if>
|
|
|
- <if test="merchantId!=0">and merchantId=#{merchantId}</if>
|
|
|
- <if test="bindOrganizationId!=0">and bindOrganizationId=#{bindOrganizationId}</if>
|
|
|
- <if test="identityId!=0">and identityId=#{identityId}</if>
|
|
|
+ <if test="organizationId!=0">and a.organizationId=#{organizationId}</if>
|
|
|
+ <if test="projectId!=0">and a.projectId=#{projectId}</if>
|
|
|
+ <if test="userId!=0">and a.userId=#{userId}</if>
|
|
|
+ <if test="clientId!=0">and a.clientId=#{clientId}</if>
|
|
|
+ <if test="agentId!=0">and a.agentId=#{agentId}</if>
|
|
|
+ <if test="merchantId!=0">and a.merchantId=#{merchantId}</if>
|
|
|
+ <if test="bindOrganizationId!=0">and a.bindOrganizationId=#{bindOrganizationId}</if>
|
|
|
+ <if test="identityId!=0">and a.identityId=#{identityId}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|