GoodsApplyMapper.xml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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="io.renren.modules.qmjz.mapper.GoodsApplyMapper">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="io.renren.modules.qmjz.entity.GoodsApplyEntity" id="goodsApplyMap">
  6. <result property="id" column="id"/>
  7. <result property="userId" column="user_id"/>
  8. <result property="goodsId" column="goods_id"/>
  9. <result property="createTime" column="create_time"/>
  10. </resultMap>
  11. <select id="queryPage" resultType="io.renren.modules.qmjz.entity.vo.GoodsApplyVo">
  12. SELECT
  13. ga.*,
  14. m.NAME userName,
  15. m.phone,
  16. si.SCHOOLNAME AS collegeName,
  17. g.`name` goodsName,
  18. gc.`name` categoryName,
  19. m.school_name
  20. FROM
  21. `tb_goods_apply` ga
  22. LEFT JOIN member_info m ON m.id = ga.user_id
  23. LEFT JOIN school_info si on m.COLLEGE = si.GUID
  24. LEFT JOIN tb_goods g ON g.id = ga.goods_id
  25. LEFT JOIN tb_goods_category gc ON gc.id = g.category_id
  26. <where>
  27. <if test="bo.goodsId != null">
  28. and ga.goods_id = #{bo.goodsId}
  29. </if>
  30. </where>
  31. ORDER BY ga.create_time DESC
  32. </select>
  33. </mapper>