HomeGroupMapper.xml 862 B

123456789101112131415161718
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.cyksj.mapper.HomeGroupMapper">
  4. <select id="getAccountIdsByUserIdOrNickNameOrSubmitAccount" resultType="java.lang.Long">
  5. select hp.account_id from home_group hp ,`user` u , groups_relation gr
  6. where hp.relation_id = gr.id and u.id = gr.user_id
  7. <if test="nickName != null and nickName != ''">
  8. and u.nickname like '%${nickName}%'
  9. </if>
  10. <if test="userId != null ">
  11. and u.id = #{userId,jdbcType=BIGINT}
  12. </if>
  13. <if test="submitAccount != null and submitAccount != ''">
  14. and gr.account = #{submitAccount,jdbcType=VARCHAR}
  15. </if>
  16. </select>
  17. </mapper>