1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?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="com.platform.dao.mapper.part.PartInfoMapper">
- <resultMap id="BaseResultMap" type="com.platform.dao.entity.part.PartInfo">
- <id column="id" jdbcType="VARCHAR" property="id"/>
- <result column="no" jdbcType="VARCHAR" property="no"/>
- <result column="name" jdbcType="VARCHAR" property="name"/>
- <result column="type_id" jdbcType="VARCHAR" property="typeId"/>
- <result column="level" jdbcType="SMALLINT" property="level"/>
- <result column="sb_id" jdbcType="VARCHAR" property="sbId"/>
- <result column="status" jdbcType="SMALLINT" property="status"/>
- <result column="remark" jdbcType="VARCHAR" property="remark"/>
- <result column="created_user_id" jdbcType="VARCHAR" property="createdUserId"/>
- <result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
- <result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
- <association column="type_id" javaType="string" property="typeName"
- select="com.platform.dao.mapper.part.PartTypeMapper.selectNameById"/>
- <association column="sb_id" javaType="string" property="sbName"
- select="com.platform.dao.mapper.sb.SbInfoMapper.selectNameById"/>
- </resultMap>
- <sql id="Base_Column_List">
- id, no, name, type_id, level, sb_id, remark, created_time, update_time
- </sql>
- <select id="selectPageList" parameterType="com.platform.dao.dto.part.PartInfoDTO" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from t_part_info
- <where>
- <if test="keyword != null and keyword != ''">
- (
- name like concat('%',#{keyword},'%') or
- no like concat('%',#{keyword},'%')
- )
- </if>
- <if test="sbId != null and sbId != ''">
- and sb_id = #{sbId}
- </if>
- </where>
- </select>
- <select id="selectById" parameterType="java.lang.Object" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from t_part_info
- where id = #{id}
- </select>
- <select id="selectNameById" parameterType="java.lang.Object" resultType="java.lang.String">
- select name
- from t_part_info
- where id = #{id}
- </select>
- </mapper>
|