Guest User

Untitled

a guest
Apr 18th, 2014
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  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="myapp.model.MyDAO">
  4. <select id="mySelect" parameterType="myapp.model.MyParameterBean" resultType="hashmap">
  5. <bind name="SL" value="_parameter.getSelectList()" />
  6. <bind name="TNS" value="_parameter.getTableNameSuffix()" />
  7. SELECT NAME
  8. #{SL}
  9. FROM MYTABLE_#{TNS}
  10. </select>
  11. </mapper>
  12.  
  13. <sql id="columns">
  14. SURNAME,ADDRESS
  15. </sql>
  16.  
  17. <select id="mySelect" resultType="hashmap">
  18. SELECT NAME,
  19. <include refid="columns">
  20. FROM MYTABLE
  21. </select>
  22.  
  23. <?xml version="1.0" encoding="UTF-8" ?>
  24. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  25. <mapper namespace="myapp.model.MyDAO">
  26. <select id="mySelect" parameterType="myapp.model.MyParameterBean" resultType="hashmap">
  27. <bind name="SL" value="_parameter.getSelectList()" />
  28. <bind name="TNS" value="_parameter.getTableNameSuffix()" />
  29. SELECT NAME
  30. #{SL}
  31. FROM MYTABLE_#{TNS}
  32. </select>
  33. </mapper>
Advertisement
Add Comment
Please, Sign In to add comment