mybatis include标签
使用mybatis 的include标签达到SQL片段达到代码复用的目的
示例:
xml文件
<sql id="paysql"> payid,p.oid,p.bdate,p.lid,lname,p.uid,p.uids,username,p.fdate,p.ysprice,reprice,p.statues,p.flag,clockdate,p.remark,remethod </sql>
<!-- 应收款项、未结清,当前用户 --> <select id="wjqPay" parameterType="Map" resultMap="paymap"> select <include refid="paysql" /> from pay p,user u,linkman l,orders o where p.lid=l.lid and u.uid=p.uid and o.oid=p.oid and p.flag=0 and p.uid=#{uid} </select>