TInteractionMapper.xml 1.46 KB
Newer Older
wzp's avatar
wzp committed
1 2 3 4 5 6 7
<?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="cn.wisenergy.chnmuseum.party.mapper.TInteractionMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.TInteraction">
        <id column="id" property="id"/>
wzp's avatar
wzp committed
8
        <result column="board_name" property="boardName"/>
wzp's avatar
wzp committed
9 10 11 12 13 14 15 16
        <result column="organ_id" property="organId"/>
        <result column="username" property="username"/>
        <result column="board_id" property="boardId"/>
        <result column="study_time" property="studyTime"/>
        <result column="num" property="num"/>
        <result column="content" property="content"/>
        <result column="images" property="images"/>
        <result column="create_time" property="createTime"/>
wzp's avatar
wzp committed
17 18
        <result column="user_id" property="userId"/>
        <result column="name" property="name"/>
wzp's avatar
wzp committed
19 20 21 22 23 24 25
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, organ_id, username, board_id, study_time, num, content, images, create_time
    </sql>

wzp's avatar
wzp committed
26
    <select id="selectPageList" resultMap="BaseResultMap">
wzp's avatar
wzp committed
27
        SELECT i.*,e.`name` board_name,u.user_name name
wzp's avatar
wzp committed
28 29
FROM t_interaction i
left join exhibition_board e on e.id = i.board_id
wzp's avatar
wzp committed
30
left join t_user u on u.id = i.user_id
wzp's avatar
wzp committed
31
        where i.organ_id =#{orgId}
wzp's avatar
wzp committed
32
        order by i.create_time desc
wzp's avatar
wzp committed
33 34
    </select>

wzp's avatar
wzp committed
35
</mapper>