MQyxxMapper.xml 3.53 KB
<?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.hotent.lpg.manage.dao.MQyxxDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hotent.lpg.common.model.WQyxx">
        <id column="ID_" property="id" />
        <result column="REF_ID_" property="refId" />
        <result column="F_qymc" property="fQymc" />
        <result column="F_qyjc" property="fQyjc" />
        <result column="F_tyshxydm" property="fTyshxydm" />
        <result column="F_qylx" property="fQylx" />
        <result column="F_qydz" property="fQydz" />
        <result column="F_jd" property="fJd" />
        <result column="F_wd" property="fWd" />
        <result column="F_zczj" property="fZczj" />
        <result column="F_jyfg" property="fJyfg" />
        <result column="F_jyqy" property="fJyqy" />
        <result column="F_qyfr" property="fQyfr" />
        <result column="F_qyfrdh" property="fQyfrdh" />
        <result column="F_zjlxm" property="fZjlxm" />
        <result column="F_zjldh" property="fZjldh" />
        <result column="F_gwlc" property="fGwlc" />
        <result column="F_cqnl" property="fCqnl" />
        <result column="F_zt" property="fZt" />
        <result column="F_cjr" property="fCjr" />
        <result column="F_gxr" property="fGxr" />
        <result column="F_form_data_rev_" property="fFormDataRev" />
        <result column="F_cjsj" property="fCjsj" />
        <result column="F_zcsj" property="fZcsj" />
        <result column="F_gxsj" property="fGxsj" />
    </resultMap>

    <resultMap id="qyxxMap" type="com.hotent.lpg.manage.vo.QyxxVO">
        <result column="qyId" property="qyId" />
        <result column="qymc" property="qymc" />
    </resultMap>

    <resultMap id="qyxxMap1"  extends="qyxxMap" type="com.hotent.lpg.manage.vo.QyxxVO">
        <collection property="qzxxList" ofType="com.hotent.lpg.manage.vo.QzxxVO"
                    select="com.hotent.lpg.dao.WCzxxDao.listByQyId"
                    column="{qyId = qyId}">
        </collection>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ID_,
        REF_ID_,
        F_qymc,
        F_qyjc,
        F_tyshxydm,
        F_qylx,
        F_qydz,
        F_jd,
        F_wd,
        F_zczj,
        F_jyfg,
        F_jyqy,
        F_qyfr,
        F_qyfrdh,
        F_zjlxm,
        F_zjldh,
        F_gwlc,
        F_cqnl,
        F_zt,
        F_cjr,
        F_gxr,
        F_form_data_rev_,
        F_cjsj,
        F_zcsj,
        F_gxsj
    </sql>

    <select id="selectPage" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from
        w_qyxx
        ${ew.customSqlSegment}
    </select>

    <select id="selectList" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from
        w_qyxx
        ${ew.customSqlSegment}
    </select>

    <select id="selectById" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from
        w_qyxx
        where
        ID_ = #{id}
    </select>

    <select id="qyList" resultMap="qyxxMap1">
        select
        w_qyxx.ID_ as qyId,
        w_qyxx.F_qymc as qymc
        from w_qyxx w_qyxx
        where 1 = 1
        <if test="list != null and list.size() > 0 ">
            and w_qyxx.ID_ in
            <foreach collection="list" item="id" open="(" close=")" separator=",">
                #{id}
            </foreach>
        </if>
    </select>
</mapper>