...
|
...
|
@@ -158,41 +158,39 @@ |
|
|
</select>
|
|
|
|
|
|
|
|
|
<sql id="Assets_Details_View_Query_Condition_Sql">
|
|
|
uid = #{uid,jdbcType=INTEGER} and income_outcome = 1 and deal_status != 1
|
|
|
and ((user_type =1 and trade_type = 3) or (user_type =2 and trade_type = 2) or (user_type =2 and trade_type = 3))
|
|
|
<if test="queryType != null and queryType = 1">
|
|
|
and trade_status = 10
|
|
|
</if>
|
|
|
<if test="queryType != null and queryType = 2">
|
|
|
and trade_status != 10
|
|
|
</if>
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectCountForAssetsDetailsView" resultType="java.lang.Integer">
|
|
|
<sql id="Assets_Details_View_Query_Condition_Sql">
|
|
|
uid = #{uid,jdbcType=INTEGER} and income_outcome = 1 and deal_status != 1
|
|
|
and ((user_type =1 and trade_type = 3) or (user_type =2 and trade_type = 2) or (user_type =2 and trade_type = 3))
|
|
|
<if test="queryType != null">
|
|
|
<if test="queryType = 1">
|
|
|
and trade_status = 10
|
|
|
</if>
|
|
|
<if test="queryType = 2">
|
|
|
and trade_status != 10
|
|
|
</if>
|
|
|
</if>
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectCountForAssetsDetailsView" resultType="java.lang.Integer" >
|
|
|
select
|
|
|
count(id)
|
|
|
from trade_bills
|
|
|
where
|
|
|
<include refid="Assets_Details_View_Query_Condition_Sql"/>
|
|
|
where <include refid="Assets_Details_View_Query_Condition_Sql" />
|
|
|
</select>
|
|
|
|
|
|
<select id="selectForAssetsDetailsView" resultMap="BaseResultMap">
|
|
|
select
|
|
|
<include refid="Base_Column_List"/>
|
|
|
<include refid="Base_Column_List" />
|
|
|
from trade_bills
|
|
|
where
|
|
|
<include refid="Assets_Details_View_Query_Condition_Sql"/>
|
|
|
where <include refid="Assets_Details_View_Query_Condition_Sql" />
|
|
|
order by id desc
|
|
|
limit #{start,jdbcType=INTEGER},#{limit,jdbcType=INTEGER}
|
|
|
limit #{start,jdbcType=INTEGER},#{limit,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
|
|
|
<select id="selectIncomeAmountForAssetsDetailsView"
|
|
|
resultType="com.yohoufo.dal.order.model.AssetsDetailsViewIncomeAmount">
|
|
|
<select id="selectIncomeAmountForAssetsDetailsView" resultType="com.yohoufo.dal.order.model.AssetsDetailsViewIncomeAmount">
|
|
|
select trade_status as tradeStatus, trade_type as tradeType ,sum(amount) as amount from trade_bills
|
|
|
where
|
|
|
<include refid="Assets_Details_View_Query_Condition_Sql"/>
|
|
|
where <include refid="Assets_Details_View_Query_Condition_Sql" />
|
|
|
group by trade_status, trade_type
|
|
|
</select>
|
|
|
|
...
|
...
|
|