| | |
| | | FROM user_position |
| | | <where> |
| | | user_id = #{uid} |
| | | <if test="state != null"> |
| | | <if test="state == 1"> |
| | | and sell_order_id is null and (status = 1 or status is null) |
| | | </if> |
| | | <if test="state == 2"> |
| | | and status = 2 |
| | | </if> |
| | | <if test="state == 0"> |
| | | and status = 0 |
| | | </if> |
| | | <if test="state != null and state != 0 and state != 1 and state != 2"> |
| | | and status = #{state, jdbcType=INTEGER} |
| | | </if> |
| | | <if test="stockCode != null and stockCode != '' "> |
| | |
| | | and stock_spell like CONCAT('%','${stockSpell}','%') |
| | | </if> |
| | | </where> |
| | | ORDER BY id DESC |
| | | <choose> |
| | | <when test="state == 2"> |
| | | ORDER BY sell_order_time DESC, id DESC |
| | | </when> |
| | | <otherwise> |
| | | ORDER BY id DESC |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | |
| | | <select id="findPositionByUserIdAndSellIdIsNull" parameterType="integer" resultMap="BaseResultMap"> |