- <resultMap id="BaseResultMap" type="com.lssrc.cms.dto.JobDto" >
- <id column="j_id" property="jId" jdbcType="VARCHAR" />
- <result column="j_title" property="jTitle" jdbcType="VARCHAR" />
- <result column="j_belong" property="jBelong" jdbcType="VARCHAR" />
- <result column="j_type" property="jType" jdbcType="VARCHAR" />
- <result column="j_content" property="jContent" jdbcType="LONGVARCHAR" />
- <association property="jobBelong" javaType="com.lssrc.cms.entity.JobBelong">
- <id column="jb_id" property="jbId" jdbcType="VARCHAR" />
- <result column="jb_name" property="jbName" jdbcType="VARCHAR" />
- </association>
- <association property="jobType" javaType="com.lssrc.cms.entity.JobType">
- <id column="jt_id" property="jtId" jdbcType="VARCHAR" />
- <result column="jt_name" property="jtName" jdbcType="VARCHAR" />
- </association>
- </resultMap>
在SQL中这样写就可以: - <select id="selectByPage" resultMap="BaseResultMap">
- select
- *
- from shsj_job, shsj_job_belong, shsj_job_type
- where
- shsj_job.j_type=shsj_job_type.jt_id and
- shsj_job.j_belong=shsj_job_belong.jb_id
- order by j_id desc
- limit #{start},#{pageSize}
- </select>
|