CollectBankMapper.xml 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zhongzheng.modules.collect.mapper.CollectBankMapper">
  6. <resultMap type="com.zhongzheng.modules.collect.domain.CollectBank" id="CollectBankResult">
  7. <result property="collectBankId" column="collect_bank_id"/>
  8. <result property="bankId" column="bank_id"/>
  9. <result property="userId" column="user_id"/>
  10. <result property="createTime" column="create_time"/>
  11. <result property="bankName" column="bank_name"/>
  12. <result property="coverUrl" column="cover_url"/>
  13. </resultMap>
  14. <select id="selectList" parameterType="com.zhongzheng.modules.collect.domain.CollectBank" resultMap="CollectBankResult">
  15. SELECT
  16. cb.*,
  17. qb.bank_name,
  18. qb.cover_url
  19. FROM
  20. collect_bank cb
  21. LEFT JOIN question_bank qb ON cb.bank_id = qb.bank_id
  22. WHERE
  23. 1 = 1
  24. <if test="userId != null and userId != ''">
  25. AND user_id = #{userId}
  26. </if>
  27. </select>
  28. </mapper>