|
|
@@ -32,9 +32,14 @@
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectCorpList" resultType="com.mokamrp.privates.mapper.pojo.Corp">
|
|
|
- SELECT * FROM mc_corp
|
|
|
-
|
|
|
- where name = #{corpName}
|
|
|
+ SELECT A.* FROM mc_corp AS A
|
|
|
+ <if test="userId != null">
|
|
|
+ RIGHT JOIN private_user_corp AS B ON B.corp_id = A.id
|
|
|
+ </if>
|
|
|
+ <where>
|
|
|
+ <if test="userId != null">AND B.user_id = #{userId} </if>
|
|
|
+ <if test="corpName != null">AND A.name like CONCAT('%',#{corpName},'%')</if>
|
|
|
+ </where>
|
|
|
|
|
|
</select>
|
|
|
|