PartInfoMapper.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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.platform.dao.mapper.part.PartInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.platform.dao.entity.part.PartInfo">
  5. <id column="id" jdbcType="VARCHAR" property="id"/>
  6. <result column="no" jdbcType="VARCHAR" property="no"/>
  7. <result column="name" jdbcType="VARCHAR" property="name"/>
  8. <result column="type_id" jdbcType="VARCHAR" property="typeId"/>
  9. <result column="level" jdbcType="SMALLINT" property="level"/>
  10. <result column="sb_id" jdbcType="VARCHAR" property="sbId"/>
  11. <result column="status" jdbcType="SMALLINT" property="status"/>
  12. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  13. <result column="created_user_id" jdbcType="VARCHAR" property="createdUserId"/>
  14. <result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
  15. <result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
  16. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  17. <association column="type_id" javaType="string" property="typeName"
  18. select="com.platform.dao.mapper.part.PartTypeMapper.selectNameById"/>
  19. <association column="sb_id" javaType="string" property="sbName"
  20. select="com.platform.dao.mapper.sb.SbInfoMapper.selectNameById"/>
  21. </resultMap>
  22. <sql id="Base_Column_List">
  23. id, no, name, type_id, level, sb_id, remark, created_time, update_time
  24. </sql>
  25. <select id="selectPageList" parameterType="com.platform.dao.dto.part.PartInfoDTO" resultMap="BaseResultMap">
  26. select
  27. <include refid="Base_Column_List"/>
  28. from t_part_info
  29. <where>
  30. <if test="keyword != null and keyword != ''">
  31. (
  32. name like concat('%',#{keyword},'%') or
  33. no like concat('%',#{keyword},'%')
  34. )
  35. </if>
  36. <if test="sbId != null and sbId != ''">
  37. and sb_id = #{sbId}
  38. </if>
  39. </where>
  40. </select>
  41. <select id="selectById" parameterType="java.lang.Object" resultMap="BaseResultMap">
  42. select
  43. <include refid="Base_Column_List"/>
  44. from t_part_info
  45. where id = #{id}
  46. </select>
  47. <select id="selectNameById" parameterType="java.lang.Object" resultType="java.lang.String">
  48. select name
  49. from t_part_info
  50. where id = #{id}
  51. </select>
  52. </mapper>