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

30 lines
2.0 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>
2020-04-09 18:50:13 +08:00
<result column="portfolio_head_img_url" property="headImgUrl"></result>
<result column="portfolio_title" property="portfolioTitle"></result>
2020-04-07 17:32:20 +08:00
<result column="portfolio_author_id" property="portfolioAuthorId"></result>
2020-04-09 18:50:13 +08:00
<result column="portfolio_description" property="portfolioDescription"></result>
2020-04-07 17:32:20 +08:00
<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>
2020-04-09 18:50:13 +08:00
<result column="portfolio_head_img_url" property="headImgUrl"></result>
<result column="portfolio_title" property="portfolioTitle"></result>
2020-04-08 17:53:32 +08:00
<result column="portfolio_author_id" property="portfolioAuthorId"></result>
2020-04-09 18:50:13 +08:00
<result column="portfolio_description" property="portfolioDescription"></result>
2020-04-08 17:53:32 +08:00
<result column="updated_time" property="updatedTime"></result>
</resultMap>
<select id="selectUserPortfoliosByIdUser" resultMap="DTOResultMap">
2020-04-09 18:50:13 +08:00
select id, portfolio_head_img_url, portfolio_title, portfolio_author_id, portfolio_description, updated_time from vertical_portfolio where portfolio_author_id = #{idUser}
2020-04-08 17:53:32 +08:00
</select>
<select id="selectPortfolioDTOById" resultMap="DTOResultMap">
2020-04-09 18:50:13 +08:00
select id, portfolio_head_img_url, portfolio_title, portfolio_author_id, portfolio_description, updated_time from vertical_portfolio where id = #{id}
2020-04-08 17:53:32 +08:00
</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>