Newer
Older
huludao / src / main / resources / mapper / ProFactorsInfoDao.xml
<?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.newfiber.api.pc.dao.monitoring.ProFactorsInfoDao">
	
	<!-- 可根据自己的需求,是否要使用 -->
    <resultMap type="com.newfiber.api.pc.model.entity.ProFactorsInfoEntity" id="proFactorsInfoMap">
            <result property="id" column="id"/>
            <result property="factorsNo" column="factors_no"/>
            <result property="factorsCode" column="factors_code"/>
            <result property="factorsAscii" column="factors_ascii"/>
            <result property="factorsName" column="factors_name"/>
            <result property="factorsUnit" column="factors_unit"/>
            <result property="factorsMaxV" column="factors_max_v"/>
            <result property="factorsMixV" column="factors_mix_v"/>
            <result property="factorsOrder" column="factors_order"/>
            <result property="createTime" column="create_time"/>
            <result property="factorsReserve1" column="factors_reserve1"/>
            <result property="factorsReserve2" column="factors_reserve2"/>
        </resultMap>
    
	<!-- 通用查询结果列 -->
	<sql id="Base_Column_List">
	<trim suffixOverrides=",">
			id,
			factors_no,
			factors_code,
			factors_ascii,
			factors_name,
			factors_unit,
			factors_max_v,
			factors_mix_v,
			factors_order,
			create_time,
			factors_reserve1,
			factors_reserve2,
	    </trim>
	</sql>
	
	<!-- 获取因子基础表列表 -->
	<select id="queryList" resultType="com.newfiber.api.pc.model.entity.ProFactorsInfoEntity">
		select
		<include refid="Base_Column_List" />
		from pro_factors_info
		where 1 = 1
		<if test="factorsName != null">
			and concat(factors_ascii,factors_name) like concat('%',#{factorsName},'%')
		</if>
        <choose>
            <when test="sidx != null and sidx.trim() != ''">
                order by ${sidx} ${order}
            </when>
			<otherwise>
                order by id desc
			</otherwise>
        </choose>
	</select>

	<select id="listFactorsByASCII" parameterType="java.util.List" resultType="ProFactorsInfoEntity">
		select
		<include refid="Base_Column_List" />
		from pro_factors_info
		where 1 = 1
		<if test="list != null and list.size() > 0">
			and factors_ascii in
			<foreach collection="list" item="item" open="(" separator="," close=")">
				#{item}
			</foreach>
		</if>
	</select>
	
</mapper>