| | |
| | | |
| | | <select id="findMyPositionByCodeAndSpell" parameterType="map" resultMap="BaseResultMap"> |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | FROM user_position |
| | | u.* |
| | | FROM user_position u left join stock s on u.stock_code = s.stock_code |
| | | <where> |
| | | user_id = #{uid} |
| | | u.user_id = #{uid} |
| | | and s.stock_type = #{stockType} |
| | | <if test="state != null "> |
| | | <if test="state == 0"> |
| | | and sell_order_id is null |
| | | and u.sell_order_id is null |
| | | </if> |
| | | <if test="state == 1"> |
| | | and sell_order_id is not null |
| | | and u.sell_order_id is not null |
| | | </if> |
| | | </if> |
| | | <if test="stockCode != null and stockCode != '' "> |
| | | and stock_code like CONCAT('%','${stockCode}','%') |
| | | and u.stock_code like CONCAT('%','${stockCode}','%') |
| | | </if> |
| | | <if test="stockSpell != null and stockSpell != '' "> |
| | | and stock_spell like CONCAT('%','${stockSpell}','%') |
| | | and u.stock_spell like CONCAT('%','${stockSpell}','%') |
| | | </if> |
| | | <!-- <if test="stockType != null and stockType!= ''">--> |
| | | <!-- and stock_gid = #{stockType}--> |
| | | <!-- </if>--> |
| | | |
| | | |
| | | |
| | | </where> |