The research of the characteristics of fish habitat changes under the impact of water conservancy projects is essential for preserving the ecological health of rivers. Taking a reach of 10 km in the downstream of the third bridge sluice of the Pingchuan section, Hanjiang River in Hanzhong as the research object, the ecological flow was calculated using the hydrological method and the habitat simulation method. A two-dimensional hydrodynamic model of the river section was established, and the targeted fish species was selected, which is Zacco Platypus. The habitat area of this species under the flow change was determined according to its suitability curve for water depth and flow velocity, and the classification of habitat quality was used to analyze the response of fish habitats to different flow patterns. It is found that the calculated river ecological flow of these two methods are very close, which are 54.3 m3/s and 53.1 m3/s respectively, and the final suitable flow is in the range of 47.8-54.3 m3/s. When the flow rate is in the range of 8.8-212.7 m3/s, the high-quality habitat area fluctuates more significantly with the flow compared with the medium-quality and low-quality habitats, showing a trend of rising first and then decreasing. However, when the flow rate exceeds 212.7 m3/s, all habitats varies little with the flow. Most of the high-quality habitats are distributed at the two banks of Hanjiang River and the intersection of Lengshui River and Hanjiang River, the medium-quality habitats are mainly located in the lower reaches of the river, whereas the low-quality habitats are relatively unstable. The research results can provide a technical support for the safe operation of bridges and sluices and the preservation of river fish.