| | |
| | | <result column="auth_msg" property="authMsg"/> |
| | | <result column="withdrawal_Pwd" property="withdrawalPwd"/> |
| | | <result column="vaild_number" property="vaildNumber"/> |
| | | <result column="amt_pwd" property="amtPwd"/> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | id, agent_id, agent_name, phone, user_pwd, with_pwd, nick_name, real_name, id_card, |
| | | account_type, is_lock, is_login, |
| | | reg_time, reg_ip, reg_address, img1_key, img2_key, img3_key, is_active, auth_msg, |
| | | withdrawal_Pwd,vaild_number,amt_pwd |
| | | withdrawal_Pwd,vaild_number |
| | | </sql> |
| | | |
| | | |
| | |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | FROM user |
| | | WHERE (phone = #{phone} or email = #{phone}) and user_pwd = #{userPwd} |
| | | WHERE phone = #{phone} and user_pwd = #{userPwd} |
| | | </select> |
| | | |
| | | <select id="listByAgent" resultMap="BaseResultMap" parameterType="map"> |
| | |
| | | select count(*) from user where TO_DAYS(reg_time) = TO_DAYS(NOW()) and agent_id = #{id} |
| | | </select> |
| | | |
| | | <select id="findByPhone" parameterType="string" resultType="com.nq.pojo.User"> |
| | | select * from user where phone= #{phone} |
| | | </select> |
| | | |
| | | |
| | | <select id="queryAgintSumTodayRegCount" parameterType="integer" resultType="int"> |
| | | select count(*) from user where agent_id =#{id} TO_DAYS(reg_time) = TO_DAYS(NOW()) |
| | |
| | | <include refid="Base_Column_List"/> |
| | | FROM user |
| | | <where> |
| | | <if test="id != null and id != '' "> |
| | | and id = #{id} |
| | | </if> |
| | | <if test="searchId != null "> |
| | | and agent_id = #{searchId} |
| | | </if> |
| | |
| | | </if> |
| | | </where> |
| | | ORDER BY id DESC |
| | | </select> |
| | | |
| | | <select id="getMarketValue" parameterType="integer" resultType="decimal"> |
| | | select SUM(order_total_price) as marketValue |
| | | from user_position |
| | | where user_id = #{user_id} and sell_order_id is null |
| | | </select> |
| | | |
| | | <select id="getProfit" parameterType="integer" resultType="Float"> |
| | | select |
| | | (select SUM(order_total_price) |
| | | from user_position |
| | | where user_id = #{user_id} and sell_order_id is null and order_direction='买涨') |
| | | - |
| | | (select SUM(order_total_price) as dsum |
| | | from user_position |
| | | where user_id = #{user_id} and sell_order_id is null and order_direction='买跌' |
| | | ) as profit |
| | | |
| | | </select> |
| | | </mapper> |