forest/src/main/java/mapper/PortfolioMapper.xml

30 lines
1.9 KiB
XML
Raw Normal View History

2020-04-07 17:32:20 +08:00
<?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.rymcu.vertical.mapper.PortfolioMapper">
<resultMap id="BaseResultMap" type="com.rymcu.vertical.entity.Portfolio">
<id column="id" property="idPortfolio"></id>
<result column="head_img_url" property="headImgUrl"></result>
<result column="name" property="name"></result>
<result column="portfolio_author_id" property="portfolioAuthorId"></result>
<result column="description" property="description"></result>
<result column="created_time" property="createdTime"></result>
<result column="updated_time" property="updatedTime"></result>
</resultMap>
2020-04-08 17:53:32 +08:00
<resultMap id="DTOResultMap" type="com.rymcu.vertical.dto.PortfolioDTO">
<result column="id" property="idPortfolio"></result>
<result column="head_img_url" property="headImgUrl"></result>
<result column="name" property="name"></result>
<result column="portfolio_author_id" property="portfolioAuthorId"></result>
<result column="description" property="description"></result>
<result column="updated_time" property="updatedTime"></result>
</resultMap>
<select id="selectUserPortfoliosByIdUser" resultMap="DTOResultMap">
select id, head_img_url, name, portfolio_author_id, description, updated_time from vertical_portfolio where portfolio_author_id = #{idUser}
</select>
<select id="selectPortfolioDTOById" resultMap="DTOResultMap">
select id, head_img_url, name, portfolio_author_id, description, updated_time from vertical_portfolio where id = #{id}
</select>
<select id="selectCountArticleNumber" resultType="java.lang.Integer">
select count(*) from vertical_portfolio_article where id_vertical_portfolio = #{idPortfolio}
</select>
2020-04-07 17:32:20 +08:00
</mapper>