Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="myapp.model.MyDAO">
- <select id="mySelect" parameterType="myapp.model.MyParameterBean" resultType="hashmap">
- <bind name="SL" value="_parameter.getSelectList()" />
- <bind name="TNS" value="_parameter.getTableNameSuffix()" />
- SELECT NAME
- #{SL}
- FROM MYTABLE_#{TNS}
- </select>
- </mapper>
- <sql id="columns">
- SURNAME,ADDRESS
- </sql>
- <select id="mySelect" resultType="hashmap">
- SELECT NAME,
- <include refid="columns">
- FROM MYTABLE
- </select>
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="myapp.model.MyDAO">
- <select id="mySelect" parameterType="myapp.model.MyParameterBean" resultType="hashmap">
- <bind name="SL" value="_parameter.getSelectList()" />
- <bind name="TNS" value="_parameter.getTableNameSuffix()" />
- SELECT NAME
- #{SL}
- FROM MYTABLE_#{TNS}
- </select>
- </mapper>
Advertisement
Add Comment
Please, Sign In to add comment