CompanyMapper.xml 1.1 KB

12345678910111213141516171819202122232425262728293031
  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="com.hssx.cloudmodel.mapper.CompanyMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.hssx.cloudmodel.entity.Company">
  6. <id column="id" property="id" />
  7. <result column="company_name" property="companyName" />
  8. <result column="company_address" property="companyAddress" />
  9. <result column="company_type" property="companyType" />
  10. </resultMap>
  11. <!-- 通用查询结果列 -->
  12. <sql id="Base_Column_List">
  13. id, company_name, company_address, company_type
  14. </sql>
  15. <select id="getListByKeyName" resultMap="BaseResultMap">
  16. select
  17. <include refid="Base_Column_List"/>
  18. from
  19. tb_company
  20. <where>
  21. <if test="keyName != null and keyName != ''">
  22. company_name like concat('%',#{keyName},'%')
  23. </if>
  24. </where>
  25. Limit #{start},#{pageSize}
  26. </select>
  27. </mapper>