|
@@ -17,9 +17,12 @@
|
|
|
<result property="updateUser" column="update_user" />
|
|
|
</resultMap>
|
|
|
<resultMap id="groupYear" type="org.springblade.modules.investment.pojo.dto.IbaProjectVolumeDTO">
|
|
|
+ <result column="project_id" property="projectId"/>
|
|
|
<result column="year" property="year"/>
|
|
|
- <collection property="numbers" ofType="java.lang.Integer" javaType="java.util.List" >
|
|
|
- <result column="month"/>
|
|
|
+ <collection property="numbers" ofType="java.lang.Integer"
|
|
|
+ javaType="java.util.List"
|
|
|
+ select="selectMonthByYearList" column="{id=project_id,year=year}">
|
|
|
+ <result column="number"/>
|
|
|
</collection>
|
|
|
</resultMap>
|
|
|
|
|
@@ -36,8 +39,16 @@
|
|
|
</update>
|
|
|
<select id="selectGroupYearList"
|
|
|
resultMap="groupYear">
|
|
|
- select `year`,`month` from iba_project_volume where project_id = #{id} and is_deleted = 0
|
|
|
- group by year, month
|
|
|
+ select project_id,`year`,`number` from iba_project_volume where project_id = #{id} and is_deleted = 0
|
|
|
+ group by year
|
|
|
order by year, month
|
|
|
</select>
|
|
|
+ <select id="selectMonthByYearList"
|
|
|
+ resultType="java.lang.Integer">
|
|
|
+ select `number` from iba_project_volume
|
|
|
+ where project_id = #{id}
|
|
|
+ and year = #{year}
|
|
|
+ and is_deleted = 0
|
|
|
+ order by month
|
|
|
+ </select>
|
|
|
</mapper>
|