MerchInfoMapper.xml 996 B

123456789101112131415161718192021222324252627282930313233
  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.ematou.wxbase.mapper.MerchInfoMapper">
  6. <sql id="merchInfoColumns">
  7. t.merch_sn,
  8. t.merch_name
  9. </sql>
  10. <!-- 插入商户信息 -->
  11. <insert id="insert">
  12. INSERT INTO merch_info(merch_sn, merch_name) VALUES (#{merchSn}, #{merchName});
  13. </insert>
  14. <!-- 根据条件查询商户信息 -->
  15. <select id="selectOne" resultType="com.ematou.wxbase.entity.MerchInfo">
  16. SELECT
  17. <include refid="merchInfoColumns" />
  18. FROM
  19. merch_info t
  20. <where>
  21. <if test="merchSn !=null and merchSn != '' ">
  22. and merch_sn = #{merchSn}
  23. </if>
  24. <if test="merchName !=null and merchName != '' ">
  25. and merch_name = #{merchName}
  26. </if>
  27. </where>
  28. </select>
  29. </mapper>