| | |
| | | <mapper namespace="cc.mrbird.febs.dapp.mapper.DappAchieveTreeDao"> |
| | | |
| | | <select id="selectByMidNode" resultType="cc.mrbird.febs.dapp.entity.DappAchieveTreeEntity"> |
| | | select * from dapp_achieve_tree where mid_node=#{memberId} |
| | | select * from dapp_achieve_tree where mid_node=#{memberId} and valid_state=1 |
| | | </select> |
| | | |
| | | <select id="selectTreeList" resultType="cc.mrbird.febs.dapp.entity.DappAchieveTreeEntity"> |
| | | select a.*, b.address, b.invite_id, b.referer_id from dapp_achieve_tree a |
| | | inner join dapp_member b on a.mid_node=b.id |
| | | inner join dapp_member b on a.mid_node=b.id and valid_state=1 |
| | | order by a.id |
| | | </select> |
| | | |
| | | <select id="selectNewestTreeNode" resultType="cc.mrbird.febs.dapp.entity.DappAchieveTreeEntity"> |
| | | select * from dapp_achieve_tree a |
| | | order by a.id desc |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="selectLastCountTreeNode" resultType="cc.mrbird.febs.dapp.entity.DappAchieveTreeEntity"> |
| | | select * from dapp_achieve_tree a |
| | | where valid_state=1 |
| | | order by a.id desc |
| | | limit #{count} |
| | | </select> |
| | | |
| | | <update id="updateNodeValidState"> |
| | | update dapp_achieve_tree |
| | | set valid_state=2 |
| | | where valid_state=1 |
| | | </update> |
| | | </mapper> |